commit ad61f7eeedc1d1ea5f6a8257e6e8b855361fbd0f Author: Codex Date: Thu May 21 08:40:16 2026 +0000 Initial codex telegram bot source diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..36ee544 --- /dev/null +++ b/.env.example @@ -0,0 +1,18 @@ +TELEGRAM_BOT_TOKEN= + +# Use absolute host paths. The socket is mounted at the same path in the container. +HOST_CODEX_SOCKET=/absolute/path/to/codex-telegram-bot/run/codex.sock +HOST_CODEX_RUN_DIR=/absolute/path/to/codex-telegram-bot/run +HOST_UPLOAD_DIR=/absolute/path/to/codex-telegram-bot/uploads + +# Host-side SQLite directory mounted to /data in the container. +DB_DIR=./data + +# Leave empty to use Codex defaults. +DEFAULT_MODEL= +DEFAULT_SANDBOX=workspace-write +POLL_TIMEOUT_SECONDS=30 + +# Container should usually match the host user so SQLite files remain writable. +BOT_UID=1001 +BOT_GID=1001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90f9ed7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Local configuration and secrets +.env +.env.* +!.env.example + +# Runtime state +/data/ +/run/ +/uploads/ +*.db +*.db-shm +*.db-wal +*.sock +*.pid +*.log + +# Build artifacts +/bin/ +/dist/ +/build/ +/tmp/ + +# Go/test artifacts +*.test +coverage.out + +# Editor/OS noise +.DS_Store +.idea/ +.vscode/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..87e77ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM golang:1.23-alpine AS build + +WORKDIR /src +COPY go.mod go.sum* ./ +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 go build -o /out/codex-telegram-bot ./cmd/bot + +FROM alpine:3.20 + +RUN adduser -D -h /home/bot bot +COPY --from=build /out/codex-telegram-bot /usr/local/bin/codex-telegram-bot + +USER bot +ENTRYPOINT ["/usr/local/bin/codex-telegram-bot"] diff --git a/PLAN.md b/PLAN.md new file mode 100644 index 0000000..8af1f4f --- /dev/null +++ b/PLAN.md @@ -0,0 +1,97 @@ +# Codex Telegram Bot Hybrid Host/App-Server Plan + +## Summary + +Create `codex-telegram-bot/` as a Docker Compose managed Go Telegram bot that connects to a **host-launched Codex CLI app-server**. Codex is not containerized: it runs from the installed host `codex` binary, using the host user's `~/.codex`, sandboxing, and workspace paths. The bot runs in Docker Compose, stores state in SQLite, and communicates with Codex through a bind-mounted Unix socket. + +## Research + +Before implementation, carefully read the official docs and check against the guidelines below. Create/Update them properly if discrepancies or new findings occur. If you are not sure, ask the user for advice/instruction. + +- Codex App Server official docs: https://developers.openai.com/codex/app-server + - App-server is intended for rich clients with authentication, conversation history, approvals, and streamed agent events. + - Protocol is JSON-RPC 2.0 with the `jsonrpc` field omitted. + - Important: `unix://` transport is WebSocket over Unix socket using HTTP Upgrade, not raw newline JSON. + - Start flow: connect, send `initialize`, send `initialized`, then `thread/start` and `turn/start`. + - Generate version-matched protocol schemas with `codex app-server generate-json-schema --out ./schemas`. + +- Telegram Bot API official docs: https://core.telegram.org/bots/api + - `sendMessage` and `editMessageText` are limited to 1-4096 chars after entity parsing. + - Callback buttons require `answerCallbackQuery`. + - `getFile` downloads are limited to 20 MB via cloud Bot API. + - `sendDocument` supports bot-sent files up to 50 MB via cloud Bot API. + - Use long polling for MVP unless webhook deployment is explicitly needed. + +- Telegram bot feature docs: https://core.telegram.org/bots/features + - Validate commands server-side regardless of BotFather command scopes. + - Reject group/supergroup/channel updates in code even if group joining is disabled. + - Use inline keyboards for approve/deny/details actions. + +## Key requirements + +- Scaffold a Go bot project: + - `cmd/bot` for the bot process. + - `internal/telegram` for commands, callbacks, message rendering, and Telegram file downloads. + - `internal/codexapp` for app-server WebSocket-over-Unix-socket JSON-RPC. + - `internal/store` for SQLite state and migrations. + - `scripts/start-codex-app-server`, `scripts/allow-user`, `scripts/remove-user`, `scripts/list-users`, `scripts/add-workspace`, `scripts/list-workspaces`. + +- Docker Compose runs only the bot: + - Build the Go bot image locally. + - Mount persistent SQLite data. + - Bind-mount the host socket path into the bot container. + - Bind-mount an upload staging directory at the same absolute path visible to host Codex. + - Do not install or run Codex CLI inside the bot container. + +- Host Codex app-server: + - Started outside Compose with `scripts/start-codex-app-server`. + - Default command: `codex app-server --listen unix://$HOST_CODEX_SOCKET`. + - Uses host `~/.codex`, host workspaces, and host sandbox behavior. + - Socket defaults to an absolute path under the project, e.g. `/home/.../codex-telegram-bot/run/codex.sock`. + +- Telegram UX: + - One-to-one chats only; reject groups, supergroups, and channels. + - Allowlisted Telegram user IDs only. + - Commands: `/start`, `/help`, `/new`, `/threads`, `/resume`, `/fork`, `/archive`, `/status`, `/cancel`, `/workspaces`, `/workspace`, `/model`, `/sandbox`, `/diff`. + - Plain text continues the active Codex thread, creating one if needed. + - Send assistant messages and rendered tool/status blocks as separate Telegram messages; chunk only when a single message exceeds Telegram limits. + - Send long output, logs, and diffs as chunked messages. + - Consider using HTML to render if markdown is weak/awkward. + - Render Codex approval requests as inline keyboards with approve, deny, and details actions. + +- SQLite state: + - `allowed_users`, `workspaces`, `sessions`, `threads`, `pending_approvals`, `audit_log`. + - Workspace paths are host absolute paths used as Codex `cwd`. + - The bot does not need direct workspace access except for upload staging. + +## Test Plan +Any interactive related test that requires user action should be done properly - ask the user to do X in telegram, then verify. + +- Unit tests: + - Allowlist enforcement and group-chat rejection. + - Workspace path validation. + - Telegram escaping, chunking, document fallback, and callback validation. + - WebSocket-over-Unix-socket JSON-RPC request correlation and reconnect behavior. + - SQLite migrations and admin scripts. + +- Integration tests: + - Use a low/mini model in codex for testing. + - Verify initialize, thread start, turn start, streamed output, approval, and cancellation. + - Verify `/start`, `/new`, `/threads`, `/resume`, `/workspace`, `/cancel`, image input, and document staging. + - Verify non-allowlisted users are rejected and logged. + +- Manual acceptance: + - Start host Codex app-server with `scripts/start-codex-app-server`. + - Run `docker compose up --build`. + - Add an allowlisted user and workspace with scripts. + - In a one-to-one Telegram chat, run `/start`, select workspace, create a thread, send a prompt, approve a Codex request, inspect output, and cancel a running turn. + +## Assumptions + +- Bot runtime is Docker Compose. +- Codex CLI app-server is launched from the installed host binary, outside Docker. +- The Unix socket is the only v1 connection between bot and Codex. +- Go is used for the bot. +- SQLite is used for state and admin-managed allowlist/workspaces. +- Codex-in-container and `codex exec` are both out of scope for MVP. +- This computer is resource limited. Use docker/docker compose for large tools/SDKs to avoid installing locally. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fff687e --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Codex Telegram Bot + +Docker Compose runs only the Go Telegram bot. Codex runs on the host through `codex app-server` and is reached through a bind-mounted Unix socket. + +## Setup + +1. Copy `.env.example` to `.env` and set `TELEGRAM_BOT_TOKEN`, `HOST_CODEX_SOCKET`, and `HOST_UPLOAD_DIR`. +2. Start the host Codex app-server: + + ```sh + scripts/start-codex-app-server + ``` + + The script starts Codex detached, writes `run/codex-app-server.pid`, logs to `run/codex-app-server.log`, and is idempotent if the socket is already live. + +3. Add at least one Telegram user and workspace: + + ```sh + scripts/allow-user 123456789 username + scripts/add-workspace /absolute/path/to/workspace "Workspace name" --default + ``` + +4. Build the bot binary when source changes: + + ```sh + scripts/build-bot + ``` + +5. Start or restart the bot without rebuilding: + + ```sh + docker compose up -d + ``` + + For normal restarts, use `docker compose restart bot`. The container runs `./bin/codex-telegram-bot` mounted read-only into Alpine; Compose does not compile Go code. + +## Commands + +The bot accepts one-to-one chats from allowlisted Telegram user IDs only. It rejects group, supergroup, and channel updates in code. + +Supported commands: `/start`, `/help`, `/new`, `/threads`, `/resume`, `/fork`, `/archive`, `/status`, `/cancel`, `/workspaces`, `/workspace`, `/model`, `/sandbox`, `/diff`. `/model` lists available Codex models as inline buttons, then shows reasoning-effort buttons for the selected model. + +Plain text continues the active Codex thread and creates one if needed. Telegram images are staged under `HOST_UPLOAD_DIR` and sent as `localImage` inputs. Other uploaded documents are staged and passed to Codex as host-visible file paths. + +## Notes + +- `HOST_UPLOAD_DIR` must be the same absolute path inside the bot container and on the host so host Codex can read staged files. +- `HOST_CODEX_SOCKET` must point to the host app-server socket. `HOST_CODEX_RUN_DIR` is mounted into the bot container at the same absolute path so socket recreation is visible without rebuilding. +- Use long polling for the MVP; webhooks are not required. diff --git a/cmd/admin/main.go b/cmd/admin/main.go new file mode 100644 index 0000000..91f56d2 --- /dev/null +++ b/cmd/admin/main.go @@ -0,0 +1,172 @@ +package main + +import ( + "context" + "errors" + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + + "codex-telegram-bot/internal/store" +) + +func main() { + if err := run(context.Background(), os.Args[1:]); err != nil { + fmt.Fprintf(os.Stderr, "error: %v\n", err) + os.Exit(1) + } +} + +func run(ctx context.Context, args []string) error { + if len(args) == 0 { + return usage() + } + dbPath := os.Getenv("DB_PATH") + if dbPath == "" { + dbPath = filepath.Join("data", "bot.db") + } + st, err := store.Open(ctx, dbPath) + if err != nil { + return err + } + defer st.Close() + + switch args[0] { + case "allow-user": + return allowUser(ctx, st, args[1:]) + case "remove-user": + return removeUser(ctx, st, args[1:]) + case "list-users": + return listUsers(ctx, st) + case "add-workspace": + return addWorkspace(ctx, st, args[1:]) + case "list-workspaces": + return listWorkspaces(ctx, st) + default: + return usage() + } +} + +func usage() error { + return errors.New(`usage: + admin allow-user TELEGRAM_USER_ID [username] [notes...] + admin remove-user TELEGRAM_USER_ID + admin list-users + admin add-workspace ABSOLUTE_PATH [label] [--default] + admin list-workspaces`) +} + +func allowUser(ctx context.Context, st *store.Store, args []string) error { + if len(args) < 1 { + return errors.New("allow-user requires TELEGRAM_USER_ID") + } + userID, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + return fmt.Errorf("invalid telegram user id: %w", err) + } + username := "" + notes := "" + if len(args) >= 2 { + username = args[1] + } + if len(args) >= 3 { + notes = strings.Join(args[2:], " ") + } + if err := st.AddAllowedUser(ctx, userID, username, notes); err != nil { + return err + } + fmt.Printf("allowed user %d\n", userID) + return nil +} + +func removeUser(ctx context.Context, st *store.Store, args []string) error { + if len(args) != 1 { + return errors.New("remove-user requires TELEGRAM_USER_ID") + } + userID, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + return fmt.Errorf("invalid telegram user id: %w", err) + } + if err := st.RemoveAllowedUser(ctx, userID); err != nil { + return err + } + fmt.Printf("removed user %d\n", userID) + return nil +} + +func listUsers(ctx context.Context, st *store.Store) error { + users, err := st.ListAllowedUsers(ctx) + if err != nil { + return err + } + if len(users) == 0 { + fmt.Println("no allowed users") + return nil + } + for _, user := range users { + if user.Username == "" && user.Notes == "" { + fmt.Printf("%d\n", user.TelegramUserID) + continue + } + fmt.Printf("%d\t%s\t%s\n", user.TelegramUserID, user.Username, user.Notes) + } + return nil +} + +func addWorkspace(ctx context.Context, st *store.Store, args []string) error { + if len(args) < 1 { + return errors.New("add-workspace requires ABSOLUTE_PATH") + } + path := args[0] + label := "" + isDefault := false + for _, arg := range args[1:] { + if arg == "--default" { + isDefault = true + continue + } + if label == "" { + label = arg + continue + } + label += " " + arg + } + clean, err := store.ValidateWorkspacePath(path) + if err != nil { + return err + } + info, err := os.Stat(clean) + if err != nil { + return fmt.Errorf("workspace path is not accessible: %w", err) + } + if !info.IsDir() { + return errors.New("workspace path must be a directory") + } + workspace, err := st.AddWorkspace(ctx, clean, label, isDefault) + if err != nil { + return err + } + fmt.Printf("workspace %d\t%s\t%s\n", workspace.ID, workspace.Label, workspace.Path) + return nil +} + +func listWorkspaces(ctx context.Context, st *store.Store) error { + workspaces, err := st.ListWorkspaces(ctx) + if err != nil { + return err + } + if len(workspaces) == 0 { + fmt.Println("no workspaces") + return nil + } + for _, workspace := range workspaces { + marker := "" + if workspace.IsDefault { + marker = "default" + } + fmt.Printf("%d\t%s\t%s\t%s\n", workspace.ID, marker, workspace.Label, workspace.Path) + } + return nil +} diff --git a/cmd/bot/main.go b/cmd/bot/main.go new file mode 100644 index 0000000..e821f4a --- /dev/null +++ b/cmd/bot/main.go @@ -0,0 +1,44 @@ +package main + +import ( + "context" + "log" + "os" + "os/signal" + "syscall" + + "codex-telegram-bot/internal/codexapp" + "codex-telegram-bot/internal/config" + "codex-telegram-bot/internal/store" + "codex-telegram-bot/internal/telegram" +) + +func main() { + logger := log.New(os.Stdout, "", log.LstdFlags) + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + cfg, err := config.Load() + if err != nil { + logger.Fatalf("config: %v", err) + } + if err := os.MkdirAll(cfg.UploadDir, 0o755); err != nil { + logger.Fatalf("upload dir: %v", err) + } + + st, err := store.Open(ctx, cfg.DatabasePath) + if err != nil { + logger.Fatalf("store: %v", err) + } + defer st.Close() + + tg := telegram.NewClient(cfg.TelegramToken) + codex := codexapp.New(cfg.CodexSocketPath, cfg.AppVersion) + defer codex.Close() + + bot := telegram.NewBot(tg, st, codex, cfg.UploadDir, cfg.DefaultModel, cfg.DefaultSandbox, cfg.PollTimeout, logger) + logger.Printf("bot starting: db=%s codex_socket=%s upload_dir=%s", cfg.DatabasePath, cfg.CodexSocketPath, cfg.UploadDir) + if err := bot.Run(ctx); err != nil && err != context.Canceled { + logger.Fatalf("bot: %v", err) + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a7e81c7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +services: + bot: + image: alpine:3.20 + restart: unless-stopped + user: "${BOT_UID:-1001}:${BOT_GID:-1001}" + entrypoint: ["/app/codex-telegram-bot"] + env_file: + - path: .env + required: false + environment: + TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:?set TELEGRAM_BOT_TOKEN} + DEFAULT_MODEL: ${DEFAULT_MODEL:-} + DEFAULT_SANDBOX: ${DEFAULT_SANDBOX:-workspace-write} + POLL_TIMEOUT_SECONDS: ${POLL_TIMEOUT_SECONDS:-30} + DB_PATH: /data/bot.db + HOST_CODEX_SOCKET: ${HOST_CODEX_SOCKET:?set HOST_CODEX_SOCKET} + HOST_UPLOAD_DIR: ${HOST_UPLOAD_DIR:?set HOST_UPLOAD_DIR} + HOST_CODEX_RUN_DIR: ${HOST_CODEX_RUN_DIR:?set HOST_CODEX_RUN_DIR} + volumes: + - ./bin/codex-telegram-bot:/app/codex-telegram-bot:ro + - ${DB_DIR:-./data}:/data + - ${HOST_CODEX_RUN_DIR:?set HOST_CODEX_RUN_DIR}:${HOST_CODEX_RUN_DIR:?set HOST_CODEX_RUN_DIR} + - ${HOST_UPLOAD_DIR:?set HOST_UPLOAD_DIR}:${HOST_UPLOAD_DIR:?set HOST_UPLOAD_DIR} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bd22cb4 --- /dev/null +++ b/go.mod @@ -0,0 +1,24 @@ +module codex-telegram-bot + +go 1.23.2 + +require ( + github.com/gorilla/websocket v1.5.3 + modernc.org/sqlite v1.33.1 +) + +require ( + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/ncruces/go-strftime v0.1.9 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + golang.org/x/sys v0.22.0 // indirect + modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect + modernc.org/libc v1.55.3 // indirect + modernc.org/mathutil v1.6.0 // indirect + modernc.org/memory v1.8.0 // indirect + modernc.org/strutil v1.2.0 // indirect + modernc.org/token v1.1.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..089dd22 --- /dev/null +++ b/go.sum @@ -0,0 +1,51 @@ +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= +github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= +github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +modernc.org/cc/v4 v4.21.4 h1:3Be/Rdo1fpr8GrQ7IVw9OHtplU4gWbb+wNgeoBMmGLQ= +modernc.org/cc/v4 v4.21.4/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.19.2 h1:lwQZgvboKD0jBwdaeVCTouxhxAyN6iawF3STraAal8Y= +modernc.org/ccgo/v4 v4.19.2/go.mod h1:ysS3mxiMV38XGRTTcgo0DQTeTmAO4oCmJl1nX9VFI3s= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 h1:5D53IMaUuA5InSeMu9eJtlQXS2NxAhyWQvkKEgXZhHI= +modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= +modernc.org/libc v1.55.3 h1:AzcW1mhlPNrRtjS5sS+eW2ISCgSOLLNyFzRh/V3Qj/U= +modernc.org/libc v1.55.3/go.mod h1:qFXepLhz+JjFThQ4kzwzOjA/y/artDeg+pcYnY+Q83w= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= +modernc.org/memory v1.8.0 h1:IqGTL6eFMaDZZhEWwcREgeMXYwmW83LYW8cROZYkg+E= +modernc.org/memory v1.8.0/go.mod h1:XPZ936zp5OMKGWPqbD3JShgd/ZoQ7899TUuQqxY+peU= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.33.1 h1:trb6Z3YYoeM9eDL1O8do81kP+0ejv+YzgyFo+Gwy0nM= +modernc.org/sqlite v1.33.1/go.mod h1:pXV2xHxhzXZsgT/RtTFAPY6JJDEvOTcTdwADQCCWD4k= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/internal/codexapp/client.go b/internal/codexapp/client.go new file mode 100644 index 0000000..5648766 --- /dev/null +++ b/internal/codexapp/client.go @@ -0,0 +1,479 @@ +package codexapp + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net" + "net/http" + "strings" + "sync" + "sync/atomic" + + "github.com/gorilla/websocket" +) + +type Client struct { + socketPath string + version string + + nextID int64 + + mu sync.Mutex + conn *websocket.Conn + pending map[int64]chan rpcResult + events chan Event + connected bool +} + +type Event struct { + ID *int64 + Method string + Params json.RawMessage + ServerRequest bool + Err error +} + +type RPCError struct { + Code int `json:"code"` + Message string `json:"message"` + Data json.RawMessage `json:"data,omitempty"` +} + +func (e RPCError) Error() string { + if e.Code == 0 { + return e.Message + } + return fmt.Sprintf("%d: %s", e.Code, e.Message) +} + +type Thread struct { + ID string `json:"id"` + SessionID string `json:"sessionId,omitempty"` + Name string `json:"name,omitempty"` + Preview string `json:"preview,omitempty"` +} + +type Turn struct { + ID string `json:"id"` + Status string `json:"status"` +} + +type InputItem struct { + Type string `json:"type"` + Text string `json:"text,omitempty"` + URL string `json:"url,omitempty"` + Path string `json:"path,omitempty"` +} + +type Model struct { + ID string `json:"id"` + Model string `json:"model"` + DisplayName string `json:"displayName"` + Description string `json:"description"` + IsDefault bool `json:"isDefault"` + DefaultReasoningEffort string `json:"defaultReasoningEffort"` + SupportedReasoningEfforts []ReasoningEffortOption `json:"supportedReasoningEfforts"` +} + +type ReasoningEffortOption struct { + Description string `json:"description"` + ReasoningEffort string `json:"reasoningEffort"` +} + +func New(socketPath, version string) *Client { + return &Client{ + socketPath: socketPath, + version: version, + pending: make(map[int64]chan rpcResult), + events: make(chan Event, 128), + } +} + +func (c *Client) Events() <-chan Event { + return c.events +} + +func (c *Client) EnsureConnected(ctx context.Context) error { + c.mu.Lock() + connected := c.connected && c.conn != nil + c.mu.Unlock() + if connected { + return nil + } + return c.Connect(ctx) +} + +func (c *Client) Connect(ctx context.Context) error { + c.mu.Lock() + if c.connected && c.conn != nil { + c.mu.Unlock() + return nil + } + c.mu.Unlock() + + dialer := websocket.Dialer{ + NetDialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { + var d net.Dialer + return d.DialContext(ctx, "unix", c.socketPath) + }, + } + conn, _, err := dialer.DialContext(ctx, "ws://codex-app-server/", http.Header{}) + if err != nil { + return fmt.Errorf("connect codex app-server unix socket %s: %w", c.socketPath, err) + } + + c.mu.Lock() + c.conn = conn + c.connected = true + c.mu.Unlock() + + go c.readLoop(conn) + + if err := c.initialize(ctx); err != nil { + _ = c.Close() + return err + } + return nil +} + +func (c *Client) Close() error { + c.mu.Lock() + conn := c.conn + c.conn = nil + c.connected = false + c.mu.Unlock() + if conn == nil { + return nil + } + return conn.Close() +} + +func (c *Client) initialize(ctx context.Context) error { + params := map[string]any{ + "clientInfo": map[string]any{ + "name": "codex_telegram_bot", + "title": "Codex Telegram Bot", + "version": c.version, + }, + "capabilities": map[string]any{ + "experimentalApi": true, + }, + } + var ignored json.RawMessage + if err := c.call(ctx, "initialize", params, &ignored); err != nil { + return err + } + return c.notify("initialized", nil) +} + +func (c *Client) StartThread(ctx context.Context, cwd, model, sandbox string) (Thread, error) { + if err := c.EnsureConnected(ctx); err != nil { + return Thread{}, err + } + params := map[string]any{ + "cwd": cwd, + "approvalPolicy": "on-request", + "sandbox": threadSandbox(sandbox), + "serviceName": "codex_telegram_bot", + } + if model != "" { + params["model"] = model + } + var result struct { + Thread Thread `json:"thread"` + } + if err := c.call(ctx, "thread/start", params, &result); err != nil { + return Thread{}, err + } + return result.Thread, nil +} + +func (c *Client) ResumeThread(ctx context.Context, threadID string) (Thread, error) { + if err := c.EnsureConnected(ctx); err != nil { + return Thread{}, err + } + var result struct { + Thread Thread `json:"thread"` + } + if err := c.call(ctx, "thread/resume", map[string]any{"threadId": threadID}, &result); err != nil { + return Thread{}, err + } + return result.Thread, nil +} + +func (c *Client) ForkThread(ctx context.Context, threadID string) (Thread, error) { + if err := c.EnsureConnected(ctx); err != nil { + return Thread{}, err + } + var result struct { + Thread Thread `json:"thread"` + } + if err := c.call(ctx, "thread/fork", map[string]any{"threadId": threadID}, &result); err != nil { + return Thread{}, err + } + return result.Thread, nil +} + +func (c *Client) ArchiveThread(ctx context.Context, threadID string) error { + if err := c.EnsureConnected(ctx); err != nil { + return err + } + var ignored json.RawMessage + return c.call(ctx, "thread/archive", map[string]any{"threadId": threadID}, &ignored) +} + +func (c *Client) StartTurn(ctx context.Context, threadID, cwd, model, reasoningEffort, sandbox string, input []InputItem) (Turn, error) { + if err := c.EnsureConnected(ctx); err != nil { + return Turn{}, err + } + params := map[string]any{ + "threadId": threadID, + "input": input, + "cwd": cwd, + "approvalPolicy": "on-request", + "sandboxPolicy": SandboxPolicy(sandbox, cwd), + } + if model != "" { + params["model"] = model + } + if reasoningEffort != "" { + params["effort"] = reasoningEffort + } + var result struct { + Turn Turn `json:"turn"` + } + if err := c.call(ctx, "turn/start", params, &result); err != nil { + return Turn{}, err + } + return result.Turn, nil +} + +func (c *Client) InterruptTurn(ctx context.Context, threadID, turnID string) error { + if err := c.EnsureConnected(ctx); err != nil { + return err + } + var ignored json.RawMessage + return c.call(ctx, "turn/interrupt", map[string]any{ + "threadId": threadID, + "turnId": turnID, + }, &ignored) +} + +func (c *Client) ListModels(ctx context.Context) ([]Model, error) { + if err := c.EnsureConnected(ctx); err != nil { + return nil, err + } + var result struct { + Data []Model `json:"data"` + } + if err := c.call(ctx, "model/list", map[string]any{"limit": 50, "includeHidden": false}, &result); err != nil { + return nil, err + } + return result.Data, nil +} + +func (c *Client) RespondServerRequest(ctx context.Context, requestID int64, result any) error { + if err := c.EnsureConnected(ctx); err != nil { + return err + } + done := make(chan error, 1) + go func() { + done <- c.write(responseEnvelope{ID: requestID, Result: result}) + }() + select { + case <-ctx.Done(): + return ctx.Err() + case err := <-done: + return err + } +} + +func (c *Client) call(ctx context.Context, method string, params any, result any) error { + id := atomic.AddInt64(&c.nextID, 1) + ch := make(chan rpcResult, 1) + + c.mu.Lock() + if c.conn == nil { + c.mu.Unlock() + return errors.New("codex app-server is not connected") + } + c.pending[id] = ch + c.mu.Unlock() + + if err := c.write(requestEnvelope{ID: id, Method: method, Params: params}); err != nil { + c.mu.Lock() + delete(c.pending, id) + c.mu.Unlock() + return err + } + + select { + case <-ctx.Done(): + c.mu.Lock() + delete(c.pending, id) + c.mu.Unlock() + return ctx.Err() + case rpc := <-ch: + if rpc.err != nil { + return rpc.err + } + if result == nil || len(rpc.result) == 0 { + return nil + } + return json.Unmarshal(rpc.result, result) + } +} + +func (c *Client) notify(method string, params any) error { + return c.write(notificationEnvelope{Method: method, Params: params}) +} + +func (c *Client) write(message any) error { + c.mu.Lock() + defer c.mu.Unlock() + if c.conn == nil { + return errors.New("codex app-server is not connected") + } + return c.conn.WriteJSON(message) +} + +func (c *Client) readLoop(conn *websocket.Conn) { + for { + var env incomingEnvelope + if err := conn.ReadJSON(&env); err != nil { + c.failConnection(conn, err) + return + } + if env.Method != "" && env.ID != nil { + c.events <- Event{ + ID: env.ID, + Method: env.Method, + Params: env.Params, + ServerRequest: true, + } + continue + } + if env.ID != nil { + c.completeCall(*env.ID, env.Result, env.Error) + continue + } + if env.Method != "" { + c.events <- Event{ + Method: env.Method, + Params: env.Params, + } + } + } +} + +func (c *Client) completeCall(id int64, result json.RawMessage, rpcErr *RPCError) { + c.mu.Lock() + ch := c.pending[id] + delete(c.pending, id) + c.mu.Unlock() + if ch == nil { + return + } + if rpcErr != nil { + ch <- rpcResult{err: *rpcErr} + return + } + ch <- rpcResult{result: result} +} + +func (c *Client) failConnection(conn *websocket.Conn, err error) { + c.mu.Lock() + if c.conn == conn { + c.conn = nil + c.connected = false + } + pending := c.pending + c.pending = make(map[int64]chan rpcResult) + c.mu.Unlock() + + for _, ch := range pending { + ch <- rpcResult{err: err} + } + c.events <- Event{Method: "connection/closed", Err: err} +} + +func DecodeParams[T any](event Event) (T, error) { + var value T + if len(event.Params) == 0 { + return value, nil + } + err := json.Unmarshal(event.Params, &value) + return value, err +} + +func NormalizeSandbox(value string) (string, error) { + switch strings.ToLower(strings.TrimSpace(value)) { + case "", "workspace-write", "workspacewrite": + return "workspace-write", nil + case "read-only", "readonly": + return "read-only", nil + case "danger-full-access", "dangerfullaccess": + return "danger-full-access", nil + default: + return "", fmt.Errorf("unsupported sandbox %q", value) + } +} + +func SandboxPolicy(sandbox, cwd string) map[string]any { + normalized, err := NormalizeSandbox(sandbox) + if err != nil { + normalized = "workspace-write" + } + switch normalized { + case "read-only": + return map[string]any{"type": "readOnly"} + case "danger-full-access": + return map[string]any{"type": "dangerFullAccess"} + default: + return map[string]any{ + "type": "workspaceWrite", + "writableRoots": []string{cwd}, + "networkAccess": false, + } + } +} + +func threadSandbox(sandbox string) string { + normalized, err := NormalizeSandbox(sandbox) + if err != nil { + return "workspace-write" + } + return normalized +} + +type requestEnvelope struct { + ID int64 `json:"id"` + Method string `json:"method"` + Params any `json:"params,omitempty"` +} + +type notificationEnvelope struct { + Method string `json:"method"` + Params any `json:"params,omitempty"` +} + +type responseEnvelope struct { + ID int64 `json:"id"` + Result any `json:"result,omitempty"` + Error any `json:"error,omitempty"` +} + +type incomingEnvelope struct { + ID *int64 `json:"id,omitempty"` + Method string `json:"method,omitempty"` + Params json.RawMessage `json:"params,omitempty"` + Result json.RawMessage `json:"result,omitempty"` + Error *RPCError `json:"error,omitempty"` +} + +type rpcResult struct { + result json.RawMessage + err error +} diff --git a/internal/codexapp/client_test.go b/internal/codexapp/client_test.go new file mode 100644 index 0000000..d5b1385 --- /dev/null +++ b/internal/codexapp/client_test.go @@ -0,0 +1,155 @@ +package codexapp + +import ( + "context" + "encoding/json" + "net" + "net/http" + "os" + "path/filepath" + "testing" + "time" + + "github.com/gorilla/websocket" +) + +func TestClientWebSocketUnixJSONRPC(t *testing.T) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + socketPath := filepath.Join(t.TempDir(), "codex.sock") + serverDone := make(chan error, 1) + ln, err := net.Listen("unix", socketPath) + if err != nil { + t.Fatal(err) + } + defer os.Remove(socketPath) + + upgrader := websocket.Upgrader{} + server := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + serverDone <- err + return + } + defer conn.Close() + + var initialize map[string]any + if err := conn.ReadJSON(&initialize); err != nil { + serverDone <- err + return + } + if initialize["method"] != "initialize" { + serverDone <- unexpectedMessage("initialize", initialize["method"]) + return + } + if err := conn.WriteJSON(map[string]any{"id": initialize["id"], "result": map[string]any{"userAgent": "test"}}); err != nil { + serverDone <- err + return + } + + var initialized map[string]any + if err := conn.ReadJSON(&initialized); err != nil { + serverDone <- err + return + } + if initialized["method"] != "initialized" { + serverDone <- unexpectedMessage("initialized", initialized["method"]) + return + } + + if err := conn.WriteJSON(map[string]any{ + "id": 99, + "method": "item/commandExecution/requestApproval", + "params": map[string]any{"threadId": "thr_1"}, + }); err != nil { + serverDone <- err + return + } + + var start map[string]any + if err := conn.ReadJSON(&start); err != nil { + serverDone <- err + return + } + if start["method"] != "thread/start" { + serverDone <- unexpectedMessage("thread/start", start["method"]) + return + } + if err := conn.WriteJSON(map[string]any{ + "id": start["id"], + "result": map[string]any{ + "thread": map[string]any{"id": "thr_1", "preview": "test"}, + }, + }); err != nil { + serverDone <- err + return + } + + var response map[string]any + if err := conn.ReadJSON(&response); err != nil { + serverDone <- err + return + } + if response["id"].(float64) != 99 || response["result"] != "accept" { + payload, _ := json.Marshal(response) + serverDone <- unexpectedMessage("approval response", string(payload)) + return + } + serverDone <- nil + })} + defer server.Close() + go func() { + _ = server.Serve(ln) + }() + + client := New(socketPath, "test") + if err := client.Connect(ctx); err != nil { + t.Fatal(err) + } + defer client.Close() + + select { + case event := <-client.Events(): + if !event.ServerRequest || event.ID == nil || *event.ID != 99 { + t.Fatalf("unexpected event: %+v", event) + } + case <-ctx.Done(): + t.Fatal(ctx.Err()) + } + + thread, err := client.StartThread(ctx, "/tmp/project", "", "workspace-write") + if err != nil { + t.Fatal(err) + } + if thread.ID != "thr_1" { + t.Fatalf("unexpected thread: %+v", thread) + } + if err := client.RespondServerRequest(ctx, 99, "accept"); err != nil { + t.Fatal(err) + } + + select { + case err := <-serverDone: + if err != nil { + t.Fatal(err) + } + case <-ctx.Done(): + t.Fatal(ctx.Err()) + } +} + +type errUnexpected string + +func (e errUnexpected) Error() string { + return "unexpected " + string(e) +} + +func unexpectedMessage(want string, got any) error { + return errUnexpected("message: want " + want + ", got " + jsonString(got)) +} + +func jsonString(value any) string { + data, _ := json.Marshal(value) + return string(data) +} diff --git a/internal/codexapp/turn.go b/internal/codexapp/turn.go new file mode 100644 index 0000000..44deeed --- /dev/null +++ b/internal/codexapp/turn.go @@ -0,0 +1,18 @@ +package codexapp + +import ( + "context" + "encoding/json" +) + +func (c *Client) SteerTurn(ctx context.Context, threadID, expectedTurnID string, input []InputItem) error { + if err := c.EnsureConnected(ctx); err != nil { + return err + } + var ignored json.RawMessage + return c.call(ctx, "turn/steer", map[string]any{ + "threadId": threadID, + "expectedTurnId": expectedTurnID, + "input": input, + }, &ignored) +} diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..954d386 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,61 @@ +package config + +import ( + "errors" + "os" + "path/filepath" + "strconv" + "time" +) + +type Config struct { + TelegramToken string + DatabasePath string + CodexSocketPath string + UploadDir string + DefaultModel string + DefaultSandbox string + PollTimeout time.Duration + AppVersion string +} + +func Load() (Config, error) { + wd, err := os.Getwd() + if err != nil { + return Config{}, err + } + + cfg := Config{ + TelegramToken: os.Getenv("TELEGRAM_BOT_TOKEN"), + DatabasePath: envOr("DB_PATH", filepath.Join(wd, "data", "bot.db")), + CodexSocketPath: envOr("HOST_CODEX_SOCKET", filepath.Join(wd, "run", "codex.sock")), + UploadDir: envOr("HOST_UPLOAD_DIR", filepath.Join(wd, "uploads")), + DefaultModel: os.Getenv("DEFAULT_MODEL"), + DefaultSandbox: envOr("DEFAULT_SANDBOX", "workspace-write"), + PollTimeout: durationSeconds("POLL_TIMEOUT_SECONDS", 30), + AppVersion: envOr("APP_VERSION", "0.1.0"), + } + if cfg.TelegramToken == "" { + return Config{}, errors.New("TELEGRAM_BOT_TOKEN is required") + } + return cfg, nil +} + +func envOr(key, fallback string) string { + if value := os.Getenv(key); value != "" { + return value + } + return fallback +} + +func durationSeconds(key string, fallback int) time.Duration { + raw := os.Getenv(key) + if raw == "" { + return time.Duration(fallback) * time.Second + } + value, err := strconv.Atoi(raw) + if err != nil || value <= 0 { + return time.Duration(fallback) * time.Second + } + return time.Duration(value) * time.Second +} diff --git a/internal/store/migrations.go b/internal/store/migrations.go new file mode 100644 index 0000000..d8d2d36 --- /dev/null +++ b/internal/store/migrations.go @@ -0,0 +1,94 @@ +package store + +type migration struct { + Name string + SQL string +} + +var migrations = []migration{ + { + Name: "initial_state", + SQL: ` +CREATE TABLE allowed_users ( + telegram_user_id INTEGER PRIMARY KEY, + username TEXT NOT NULL DEFAULT '', + notes TEXT NOT NULL DEFAULT '', + added_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE TABLE workspaces ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + path TEXT NOT NULL UNIQUE, + label TEXT NOT NULL, + is_default INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE TABLE sessions ( + telegram_user_id INTEGER PRIMARY KEY, + active_thread_id INTEGER, + active_workspace_id INTEGER, + model TEXT NOT NULL DEFAULT '', + sandbox TEXT NOT NULL DEFAULT 'workspace-write', + active_turn_id TEXT NOT NULL DEFAULT '', + updated_at TEXT NOT NULL DEFAULT (datetime('now')), + FOREIGN KEY(active_thread_id) REFERENCES threads(id) ON DELETE SET NULL, + FOREIGN KEY(active_workspace_id) REFERENCES workspaces(id) ON DELETE SET NULL +); + +CREATE TABLE threads ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + telegram_user_id INTEGER NOT NULL, + codex_thread_id TEXT NOT NULL UNIQUE, + workspace_id INTEGER NOT NULL, + title TEXT NOT NULL DEFAULT '', + archived INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT (datetime('now')), + updated_at TEXT NOT NULL DEFAULT (datetime('now')), + FOREIGN KEY(workspace_id) REFERENCES workspaces(id) ON DELETE RESTRICT +); + +CREATE INDEX idx_threads_user_updated ON threads(telegram_user_id, archived, updated_at DESC); + +CREATE TABLE pending_approvals ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + telegram_user_id INTEGER NOT NULL, + codex_request_id TEXT NOT NULL, + codex_thread_id TEXT NOT NULL, + turn_id TEXT NOT NULL DEFAULT '', + item_id TEXT NOT NULL DEFAULT '', + kind TEXT NOT NULL, + payload_json TEXT NOT NULL, + message_chat_id INTEGER NOT NULL DEFAULT 0, + message_id INTEGER NOT NULL DEFAULT 0, + status TEXT NOT NULL DEFAULT 'pending', + created_at TEXT NOT NULL DEFAULT (datetime('now')), + resolved_at TEXT NOT NULL DEFAULT '', + UNIQUE(telegram_user_id, codex_request_id) +); + +CREATE INDEX idx_pending_approvals_status ON pending_approvals(telegram_user_id, status); + +CREATE TABLE audit_log ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + telegram_user_id INTEGER NOT NULL DEFAULT 0, + action TEXT NOT NULL, + details TEXT NOT NULL DEFAULT '', + created_at TEXT NOT NULL DEFAULT (datetime('now')) +); + +CREATE INDEX idx_audit_user_created ON audit_log(telegram_user_id, created_at DESC); +`, + }, + { + Name: "session_reasoning_effort", + SQL: "ALTER TABLE sessions ADD COLUMN reasoning_effort TEXT NOT NULL DEFAULT ''", + }, + { + Name: "session_settings_message", + SQL: ` +ALTER TABLE sessions ADD COLUMN settings_chat_id INTEGER NOT NULL DEFAULT 0; +ALTER TABLE sessions ADD COLUMN settings_message_id INTEGER NOT NULL DEFAULT 0; +`, + }, +} diff --git a/internal/store/store.go b/internal/store/store.go new file mode 100644 index 0000000..8a5e7f4 --- /dev/null +++ b/internal/store/store.go @@ -0,0 +1,516 @@ +package store + +import ( + "context" + "database/sql" + "errors" + "fmt" + "os" + "path/filepath" + "strings" + + _ "modernc.org/sqlite" +) + +type Store struct { + db *sql.DB +} + +type AllowedUser struct { + TelegramUserID int64 + Username string + Notes string + AddedAt string +} + +type Workspace struct { + ID int64 + Path string + Label string + IsDefault bool + CreatedAt string +} + +type Session struct { + TelegramUserID int64 + ActiveThreadID int64 + ActiveWorkspaceID int64 + Model string + ReasoningEffort string + Sandbox string + ActiveTurnID string + SettingsChatID int64 + SettingsMessageID int + UpdatedAt string +} + +type Thread struct { + ID int64 + TelegramUserID int64 + CodexThreadID string + WorkspaceID int64 + Title string + Archived bool + CreatedAt string + UpdatedAt string +} + +type PendingApproval struct { + ID int64 + TelegramUserID int64 + CodexRequestID string + CodexThreadID string + TurnID string + ItemID string + Kind string + PayloadJSON string + MessageChatID int64 + MessageID int + Status string + CreatedAt string + ResolvedAt string +} + +func Open(ctx context.Context, path string) (*Store, error) { + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + return nil, err + } + db, err := sql.Open("sqlite", path) + if err != nil { + return nil, err + } + db.SetMaxOpenConns(1) + + s := &Store{db: db} + if err := s.configure(ctx); err != nil { + _ = db.Close() + return nil, err + } + if err := s.migrate(ctx); err != nil { + _ = db.Close() + return nil, err + } + return s, nil +} + +func (s *Store) Close() error { + return s.db.Close() +} + +func (s *Store) configure(ctx context.Context) error { + statements := []string{ + "PRAGMA foreign_keys = ON", + "PRAGMA journal_mode = WAL", + "PRAGMA busy_timeout = 5000", + } + for _, statement := range statements { + if _, err := s.db.ExecContext(ctx, statement); err != nil { + return err + } + } + return nil +} + +func (s *Store) migrate(ctx context.Context) error { + if _, err := s.db.ExecContext(ctx, ` +CREATE TABLE IF NOT EXISTS schema_migrations ( + version INTEGER PRIMARY KEY, + name TEXT NOT NULL, + applied_at TEXT NOT NULL DEFAULT (datetime('now')) +)`); err != nil { + return err + } + + var current int + if err := s.db.QueryRowContext(ctx, "SELECT COALESCE(MAX(version), 0) FROM schema_migrations").Scan(¤t); err != nil { + return err + } + for i := current; i < len(migrations); i++ { + version := i + 1 + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + if _, err := tx.ExecContext(ctx, migrations[i].SQL); err != nil { + _ = tx.Rollback() + return fmt.Errorf("migration %d %s: %w", version, migrations[i].Name, err) + } + if _, err := tx.ExecContext(ctx, "INSERT INTO schema_migrations (version, name) VALUES (?, ?)", version, migrations[i].Name); err != nil { + _ = tx.Rollback() + return err + } + if err := tx.Commit(); err != nil { + return err + } + } + return nil +} + +func ValidateWorkspacePath(path string) (string, error) { + if path == "" { + return "", errors.New("workspace path is required") + } + if strings.ContainsRune(path, 0) { + return "", errors.New("workspace path contains a NUL byte") + } + if !filepath.IsAbs(path) { + return "", errors.New("workspace path must be absolute") + } + clean := filepath.Clean(path) + if clean == string(filepath.Separator) { + return "", errors.New("workspace path cannot be filesystem root") + } + return clean, nil +} + +func (s *Store) IsAllowed(ctx context.Context, telegramUserID int64) (bool, error) { + var exists int + err := s.db.QueryRowContext(ctx, "SELECT 1 FROM allowed_users WHERE telegram_user_id = ?", telegramUserID).Scan(&exists) + if errors.Is(err, sql.ErrNoRows) { + return false, nil + } + return err == nil, err +} + +func (s *Store) AddAllowedUser(ctx context.Context, telegramUserID int64, username, notes string) error { + _, err := s.db.ExecContext(ctx, ` +INSERT INTO allowed_users (telegram_user_id, username, notes) +VALUES (?, ?, ?) +ON CONFLICT(telegram_user_id) DO UPDATE SET username = excluded.username, notes = excluded.notes`, + telegramUserID, username, notes) + return err +} + +func (s *Store) RemoveAllowedUser(ctx context.Context, telegramUserID int64) error { + _, err := s.db.ExecContext(ctx, "DELETE FROM allowed_users WHERE telegram_user_id = ?", telegramUserID) + return err +} + +func (s *Store) ListAllowedUsers(ctx context.Context) ([]AllowedUser, error) { + rows, err := s.db.QueryContext(ctx, "SELECT telegram_user_id, username, notes, added_at FROM allowed_users ORDER BY telegram_user_id") + if err != nil { + return nil, err + } + defer rows.Close() + + var users []AllowedUser + for rows.Next() { + var user AllowedUser + if err := rows.Scan(&user.TelegramUserID, &user.Username, &user.Notes, &user.AddedAt); err != nil { + return nil, err + } + users = append(users, user) + } + return users, rows.Err() +} + +func (s *Store) AddWorkspace(ctx context.Context, path, label string, isDefault bool) (Workspace, error) { + clean, err := ValidateWorkspacePath(path) + if err != nil { + return Workspace{}, err + } + if label == "" { + label = filepath.Base(clean) + } + + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return Workspace{}, err + } + if isDefault { + if _, err := tx.ExecContext(ctx, "UPDATE workspaces SET is_default = 0"); err != nil { + _ = tx.Rollback() + return Workspace{}, err + } + } + result, err := tx.ExecContext(ctx, ` +INSERT INTO workspaces (path, label, is_default) +VALUES (?, ?, ?) +ON CONFLICT(path) DO UPDATE SET label = excluded.label, is_default = excluded.is_default`, + clean, label, boolInt(isDefault)) + if err != nil { + _ = tx.Rollback() + return Workspace{}, err + } + if err := tx.Commit(); err != nil { + return Workspace{}, err + } + + id, _ := result.LastInsertId() + if id == 0 { + return s.GetWorkspaceByPath(ctx, clean) + } + return s.GetWorkspaceByPath(ctx, clean) +} + +func (s *Store) ListWorkspaces(ctx context.Context) ([]Workspace, error) { + rows, err := s.db.QueryContext(ctx, "SELECT id, path, label, is_default, created_at FROM workspaces ORDER BY is_default DESC, label, path") + if err != nil { + return nil, err + } + defer rows.Close() + + var workspaces []Workspace + for rows.Next() { + workspace, err := scanWorkspace(rows) + if err != nil { + return nil, err + } + workspaces = append(workspaces, workspace) + } + return workspaces, rows.Err() +} + +func (s *Store) GetWorkspaceByID(ctx context.Context, id int64) (Workspace, error) { + row := s.db.QueryRowContext(ctx, "SELECT id, path, label, is_default, created_at FROM workspaces WHERE id = ?", id) + return scanWorkspace(row) +} + +func (s *Store) GetWorkspaceByPath(ctx context.Context, path string) (Workspace, error) { + row := s.db.QueryRowContext(ctx, "SELECT id, path, label, is_default, created_at FROM workspaces WHERE path = ?", path) + return scanWorkspace(row) +} + +func (s *Store) DefaultWorkspace(ctx context.Context) (Workspace, error) { + row := s.db.QueryRowContext(ctx, "SELECT id, path, label, is_default, created_at FROM workspaces ORDER BY is_default DESC, id ASC LIMIT 1") + return scanWorkspace(row) +} + +func (s *Store) GetOrCreateSession(ctx context.Context, telegramUserID int64, defaultModel, defaultSandbox string) (Session, error) { + if defaultSandbox == "" { + defaultSandbox = "workspace-write" + } + _, err := s.db.ExecContext(ctx, ` +INSERT INTO sessions (telegram_user_id, model, sandbox) +VALUES (?, ?, ?) +ON CONFLICT(telegram_user_id) DO NOTHING`, telegramUserID, defaultModel, defaultSandbox) + if err != nil { + return Session{}, err + } + return s.GetSession(ctx, telegramUserID) +} + +func (s *Store) GetSession(ctx context.Context, telegramUserID int64) (Session, error) { + row := s.db.QueryRowContext(ctx, ` +SELECT telegram_user_id, COALESCE(active_thread_id, 0), COALESCE(active_workspace_id, 0), model, COALESCE(reasoning_effort, ''), sandbox, active_turn_id, COALESCE(settings_chat_id, 0), COALESCE(settings_message_id, 0), updated_at +FROM sessions WHERE telegram_user_id = ?`, telegramUserID) + var session Session + err := row.Scan(&session.TelegramUserID, &session.ActiveThreadID, &session.ActiveWorkspaceID, &session.Model, &session.ReasoningEffort, &session.Sandbox, &session.ActiveTurnID, &session.SettingsChatID, &session.SettingsMessageID, &session.UpdatedAt) + return session, err +} + +func (s *Store) SetSessionWorkspace(ctx context.Context, telegramUserID, workspaceID int64) error { + _, err := s.db.ExecContext(ctx, ` +UPDATE sessions SET active_workspace_id = ?, updated_at = datetime('now') +WHERE telegram_user_id = ?`, workspaceID, telegramUserID) + return err +} + +func (s *Store) SetSessionModel(ctx context.Context, telegramUserID int64, model string) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET model = ?, reasoning_effort = '', updated_at = datetime('now') WHERE telegram_user_id = ?", model, telegramUserID) + return err +} + +func (s *Store) SetSessionReasoningEffort(ctx context.Context, telegramUserID int64, effort string) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET reasoning_effort = ?, updated_at = datetime('now') WHERE telegram_user_id = ?", effort, telegramUserID) + return err +} + +func (s *Store) SetSessionSettingsMessage(ctx context.Context, telegramUserID int64, chatID int64, messageID int) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET settings_chat_id = ?, settings_message_id = ?, updated_at = datetime('now') WHERE telegram_user_id = ?", chatID, messageID, telegramUserID) + return err +} + +func (s *Store) SetSessionSandbox(ctx context.Context, telegramUserID int64, sandbox string) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET sandbox = ?, updated_at = datetime('now') WHERE telegram_user_id = ?", sandbox, telegramUserID) + return err +} + +func (s *Store) SetActiveThread(ctx context.Context, telegramUserID, threadID int64) error { + _, err := s.db.ExecContext(ctx, ` +UPDATE sessions SET active_thread_id = ?, active_turn_id = '', updated_at = datetime('now') +WHERE telegram_user_id = ?`, threadID, telegramUserID) + return err +} + +func (s *Store) SetActiveTurn(ctx context.Context, telegramUserID int64, turnID string) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET active_turn_id = ?, updated_at = datetime('now') WHERE telegram_user_id = ?", turnID, telegramUserID) + return err +} + +func (s *Store) ClearActiveTurns(ctx context.Context) error { + _, err := s.db.ExecContext(ctx, "UPDATE sessions SET active_turn_id = '', updated_at = datetime('now') WHERE active_turn_id <> ''") + return err +} + +func (s *Store) CreateThread(ctx context.Context, telegramUserID int64, codexThreadID string, workspaceID int64, title string) (Thread, error) { + result, err := s.db.ExecContext(ctx, ` +INSERT INTO threads (telegram_user_id, codex_thread_id, workspace_id, title) +VALUES (?, ?, ?, ?)`, telegramUserID, codexThreadID, workspaceID, title) + if err != nil { + return Thread{}, err + } + id, err := result.LastInsertId() + if err != nil { + return Thread{}, err + } + return s.GetThreadByID(ctx, telegramUserID, id) +} + +func (s *Store) GetThreadByID(ctx context.Context, telegramUserID, id int64) (Thread, error) { + row := s.db.QueryRowContext(ctx, ` +SELECT id, telegram_user_id, codex_thread_id, workspace_id, title, archived, created_at, updated_at +FROM threads WHERE telegram_user_id = ? AND id = ?`, telegramUserID, id) + return scanThread(row) +} + +func (s *Store) GetThreadByCodexID(ctx context.Context, codexThreadID string) (Thread, error) { + row := s.db.QueryRowContext(ctx, ` +SELECT id, telegram_user_id, codex_thread_id, workspace_id, title, archived, created_at, updated_at +FROM threads WHERE codex_thread_id = ?`, codexThreadID) + return scanThread(row) +} + +func (s *Store) ListThreads(ctx context.Context, telegramUserID int64, includeArchived bool) ([]Thread, error) { + return s.ListThreadsPage(ctx, telegramUserID, includeArchived, 20, 0) +} + +func (s *Store) ListThreadsPage(ctx context.Context, telegramUserID int64, includeArchived bool, limit, offset int) ([]Thread, error) { + if limit <= 0 { + limit = 20 + } + if offset < 0 { + offset = 0 + } + query := ` +SELECT id, telegram_user_id, codex_thread_id, workspace_id, title, archived, created_at, updated_at +FROM threads WHERE telegram_user_id = ?` + args := []any{telegramUserID} + if !includeArchived { + query += " AND archived = 0" + } + query += " ORDER BY updated_at DESC, id DESC LIMIT ? OFFSET ?" + args = append(args, limit, offset) + + rows, err := s.db.QueryContext(ctx, query, args...) + if err != nil { + return nil, err + } + defer rows.Close() + + var threads []Thread + for rows.Next() { + thread, err := scanThread(rows) + if err != nil { + return nil, err + } + threads = append(threads, thread) + } + return threads, rows.Err() +} + +func (s *Store) ArchiveThread(ctx context.Context, telegramUserID, id int64) error { + _, err := s.db.ExecContext(ctx, ` +UPDATE threads SET archived = 1, updated_at = datetime('now') +WHERE telegram_user_id = ? AND id = ?`, telegramUserID, id) + return err +} + +func (s *Store) TouchThread(ctx context.Context, codexThreadID string) error { + _, err := s.db.ExecContext(ctx, "UPDATE threads SET updated_at = datetime('now') WHERE codex_thread_id = ?", codexThreadID) + return err +} + +func (s *Store) UpsertPendingApproval(ctx context.Context, approval PendingApproval) (PendingApproval, error) { + _, err := s.db.ExecContext(ctx, ` +INSERT INTO pending_approvals ( + telegram_user_id, codex_request_id, codex_thread_id, turn_id, item_id, kind, payload_json, + message_chat_id, message_id, status +) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'pending') +ON CONFLICT(telegram_user_id, codex_request_id) DO UPDATE SET + payload_json = excluded.payload_json, + message_chat_id = excluded.message_chat_id, + message_id = excluded.message_id, + status = 'pending', + resolved_at = ''`, + approval.TelegramUserID, approval.CodexRequestID, approval.CodexThreadID, approval.TurnID, + approval.ItemID, approval.Kind, approval.PayloadJSON, approval.MessageChatID, approval.MessageID) + if err != nil { + return PendingApproval{}, err + } + return s.GetPendingApprovalByRequest(ctx, approval.TelegramUserID, approval.CodexRequestID) +} + +func (s *Store) UpdatePendingApprovalMessage(ctx context.Context, id int64, chatID int64, messageID int) error { + _, err := s.db.ExecContext(ctx, "UPDATE pending_approvals SET message_chat_id = ?, message_id = ? WHERE id = ?", chatID, messageID, id) + return err +} + +func (s *Store) GetPendingApproval(ctx context.Context, telegramUserID, id int64) (PendingApproval, error) { + row := s.db.QueryRowContext(ctx, ` +SELECT id, telegram_user_id, codex_request_id, codex_thread_id, turn_id, item_id, kind, payload_json, + message_chat_id, message_id, status, created_at, COALESCE(resolved_at, '') +FROM pending_approvals WHERE telegram_user_id = ? AND id = ?`, telegramUserID, id) + return scanPendingApproval(row) +} + +func (s *Store) GetPendingApprovalByRequest(ctx context.Context, telegramUserID int64, requestID string) (PendingApproval, error) { + row := s.db.QueryRowContext(ctx, ` +SELECT id, telegram_user_id, codex_request_id, codex_thread_id, turn_id, item_id, kind, payload_json, + message_chat_id, message_id, status, created_at, COALESCE(resolved_at, '') +FROM pending_approvals WHERE telegram_user_id = ? AND codex_request_id = ?`, telegramUserID, requestID) + return scanPendingApproval(row) +} + +func (s *Store) ResolvePendingApproval(ctx context.Context, telegramUserID, id int64, status string) error { + _, err := s.db.ExecContext(ctx, ` +UPDATE pending_approvals SET status = ?, resolved_at = datetime('now') +WHERE telegram_user_id = ? AND id = ? AND status = 'pending'`, status, telegramUserID, id) + return err +} + +func (s *Store) Audit(ctx context.Context, telegramUserID int64, action, details string) error { + _, err := s.db.ExecContext(ctx, "INSERT INTO audit_log (telegram_user_id, action, details) VALUES (?, ?, ?)", telegramUserID, action, details) + return err +} + +type scanner interface { + Scan(dest ...any) error +} + +func scanWorkspace(row scanner) (Workspace, error) { + var workspace Workspace + var isDefault int + if err := row.Scan(&workspace.ID, &workspace.Path, &workspace.Label, &isDefault, &workspace.CreatedAt); err != nil { + return Workspace{}, err + } + workspace.IsDefault = isDefault != 0 + return workspace, nil +} + +func scanThread(row scanner) (Thread, error) { + var thread Thread + var archived int + if err := row.Scan(&thread.ID, &thread.TelegramUserID, &thread.CodexThreadID, &thread.WorkspaceID, &thread.Title, &archived, &thread.CreatedAt, &thread.UpdatedAt); err != nil { + return Thread{}, err + } + thread.Archived = archived != 0 + return thread, nil +} + +func scanPendingApproval(row scanner) (PendingApproval, error) { + var approval PendingApproval + if err := row.Scan(&approval.ID, &approval.TelegramUserID, &approval.CodexRequestID, &approval.CodexThreadID, + &approval.TurnID, &approval.ItemID, &approval.Kind, &approval.PayloadJSON, &approval.MessageChatID, + &approval.MessageID, &approval.Status, &approval.CreatedAt, &approval.ResolvedAt); err != nil { + return PendingApproval{}, err + } + return approval, nil +} + +func boolInt(value bool) int { + if value { + return 1 + } + return 0 +} diff --git a/internal/store/store_test.go b/internal/store/store_test.go new file mode 100644 index 0000000..e985654 --- /dev/null +++ b/internal/store/store_test.go @@ -0,0 +1,137 @@ +package store + +import ( + "context" + "path/filepath" + "testing" +) + +func TestStoreUsersWorkspacesSessions(t *testing.T) { + ctx := context.Background() + st, err := Open(ctx, filepath.Join(t.TempDir(), "bot.db")) + if err != nil { + t.Fatal(err) + } + defer st.Close() + + allowed, err := st.IsAllowed(ctx, 42) + if err != nil { + t.Fatal(err) + } + if allowed { + t.Fatal("new user should not be allowed") + } + if err := st.AddAllowedUser(ctx, 42, "alice", "owner"); err != nil { + t.Fatal(err) + } + allowed, err = st.IsAllowed(ctx, 42) + if err != nil { + t.Fatal(err) + } + if !allowed { + t.Fatal("user should be allowed") + } + + workspacePath := t.TempDir() + ws, err := st.AddWorkspace(ctx, workspacePath, "repo", true) + if err != nil { + t.Fatal(err) + } + if !ws.IsDefault { + t.Fatal("workspace should be default") + } + + session, err := st.GetOrCreateSession(ctx, 42, "test-model", "read-only") + if err != nil { + t.Fatal(err) + } + if session.Model != "test-model" || session.Sandbox != "read-only" || session.ReasoningEffort != "" { + t.Fatalf("unexpected session defaults: %+v", session) + } + if err := st.SetSessionWorkspace(ctx, 42, ws.ID); err != nil { + t.Fatal(err) + } + effort := "value-returned-by-server" + if err := st.SetSessionReasoningEffort(ctx, 42, effort); err != nil { + t.Fatal(err) + } + session, err = st.GetSession(ctx, 42) + if err != nil { + t.Fatal(err) + } + if session.ActiveWorkspaceID != ws.ID || session.ReasoningEffort != effort { + t.Fatalf("workspace not saved: %+v", session) + } + if err := st.SetSessionSettingsMessage(ctx, 42, 1001, 2002); err != nil { + t.Fatal(err) + } + session, err = st.GetSession(ctx, 42) + if err != nil { + t.Fatal(err) + } + if session.SettingsChatID != 1001 || session.SettingsMessageID != 2002 { + t.Fatalf("settings message not saved: %+v", session) + } + if err := st.SetActiveTurn(ctx, 42, "turn-123"); err != nil { + t.Fatal(err) + } + if err := st.ClearActiveTurns(ctx); err != nil { + t.Fatal(err) + } + session, err = st.GetSession(ctx, 42) + if err != nil { + t.Fatal(err) + } + if session.ActiveTurnID != "" { + t.Fatalf("active turn not cleared: %+v", session) + } +} + +func TestListThreadsPage(t *testing.T) { + ctx := context.Background() + st, err := Open(ctx, filepath.Join(t.TempDir(), "bot.db")) + if err != nil { + t.Fatal(err) + } + defer st.Close() + + ws, err := st.AddWorkspace(ctx, t.TempDir(), "repo", true) + if err != nil { + t.Fatal(err) + } + for i := 0; i < 3; i++ { + if _, err := st.CreateThread(ctx, 42, string(rune('a'+i)), ws.ID, "thread"); err != nil { + t.Fatal(err) + } + } + threads, err := st.ListThreadsPage(ctx, 42, false, 2, 0) + if err != nil { + t.Fatal(err) + } + if len(threads) != 2 { + t.Fatalf("got %d threads, want 2", len(threads)) + } + threads, err = st.ListThreadsPage(ctx, 42, false, 2, 2) + if err != nil { + t.Fatal(err) + } + if len(threads) != 1 { + t.Fatalf("got %d threads on second page, want 1", len(threads)) + } +} + +func TestValidateWorkspacePath(t *testing.T) { + if _, err := ValidateWorkspacePath("relative/path"); err == nil { + t.Fatal("relative path should be rejected") + } + if _, err := ValidateWorkspacePath("/"); err == nil { + t.Fatal("filesystem root should be rejected") + } + clean, err := ValidateWorkspacePath("/tmp/../tmp/project") + if err != nil { + t.Fatal(err) + } + if clean != "/tmp/project" { + t.Fatalf("unexpected clean path: %s", clean) + } +} diff --git a/internal/telegram/api.go b/internal/telegram/api.go new file mode 100644 index 0000000..2801451 --- /dev/null +++ b/internal/telegram/api.go @@ -0,0 +1,211 @@ +package telegram + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "path/filepath" + "time" +) + +type Client struct { + token string + baseURL string + fileBaseURL string + httpClient *http.Client +} + +func NewClient(token string) *Client { + return &Client{ + token: token, + baseURL: "https://api.telegram.org/bot" + token, + fileBaseURL: "https://api.telegram.org/file/bot" + token, + httpClient: &http.Client{Timeout: 90 * time.Second}, + } +} + +func (c *Client) GetUpdates(ctx context.Context, offset int, timeoutSeconds int) ([]Update, error) { + params := map[string]any{ + "offset": offset, + "timeout": timeoutSeconds, + "allowed_updates": []string{"message", "callback_query"}, + } + var updates []Update + if err := c.postJSON(ctx, "getUpdates", params, &updates); err != nil { + return nil, err + } + return updates, nil +} + +func (c *Client) SendMessage(ctx context.Context, chatID int64, text string, opts SendMessageOptions) (Message, error) { + params := map[string]any{ + "chat_id": chatID, + "text": text, + } + if opts.ParseMode != "" { + params["parse_mode"] = opts.ParseMode + } + if opts.ReplyMarkup != nil { + params["reply_markup"] = opts.ReplyMarkup + } + var message Message + if err := c.postJSON(ctx, "sendMessage", params, &message); err != nil { + return Message{}, err + } + return message, nil +} + +func (c *Client) EditMessageText(ctx context.Context, chatID int64, messageID int, text string, opts EditMessageTextOptions) (Message, error) { + params := map[string]any{ + "chat_id": chatID, + "message_id": messageID, + "text": text, + } + if opts.ParseMode != "" { + params["parse_mode"] = opts.ParseMode + } + if opts.ReplyMarkup != nil { + params["reply_markup"] = opts.ReplyMarkup + } + var message Message + if err := c.postJSON(ctx, "editMessageText", params, &message); err != nil { + return Message{}, err + } + return message, nil +} + +func (c *Client) PinChatMessage(ctx context.Context, chatID int64, messageID int, disableNotification bool) error { + params := map[string]any{ + "chat_id": chatID, + "message_id": messageID, + "disable_notification": disableNotification, + } + var ignored bool + return c.postJSON(ctx, "pinChatMessage", params, &ignored) +} + +func (c *Client) AnswerCallbackQuery(ctx context.Context, callbackQueryID, text string) error { + params := map[string]any{ + "callback_query_id": callbackQueryID, + } + if text != "" { + params["text"] = text + } + var ignored bool + return c.postJSON(ctx, "answerCallbackQuery", params, &ignored) +} + +func (c *Client) GetFile(ctx context.Context, fileID string) (File, error) { + var file File + if err := c.postJSON(ctx, "getFile", map[string]any{"file_id": fileID}, &file); err != nil { + return File{}, err + } + return file, nil +} + +func (c *Client) DownloadFile(ctx context.Context, filePath string) ([]byte, error) { + u := c.fileBaseURL + "/" + url.PathEscape(filePath) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u, nil) + if err != nil { + return nil, err + } + resp, err := c.httpClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, fmt.Errorf("download file: telegram returned %s", resp.Status) + } + return io.ReadAll(resp.Body) +} + +func (c *Client) SendDocumentBytes(ctx context.Context, chatID int64, filename string, data []byte, caption string) (Message, error) { + var body bytes.Buffer + writer := multipart.NewWriter(&body) + if err := writer.WriteField("chat_id", fmt.Sprint(chatID)); err != nil { + return Message{}, err + } + if caption != "" { + if err := writer.WriteField("caption", caption); err != nil { + return Message{}, err + } + } + part, err := writer.CreateFormFile("document", filepath.Base(filename)) + if err != nil { + return Message{}, err + } + if _, err := part.Write(data); err != nil { + return Message{}, err + } + if err := writer.Close(); err != nil { + return Message{}, err + } + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+"/sendDocument", &body) + if err != nil { + return Message{}, err + } + req.Header.Set("Content-Type", writer.FormDataContentType()) + resp, err := c.httpClient.Do(req) + if err != nil { + return Message{}, err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + payload, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return Message{}, fmt.Errorf("sendDocument: telegram returned %s: %s", resp.Status, string(payload)) + } + var decoded apiResponse[Message] + if err := json.NewDecoder(resp.Body).Decode(&decoded); err != nil { + return Message{}, err + } + if !decoded.OK { + return Message{}, fmt.Errorf("sendDocument: telegram error %d: %s", decoded.ErrorCode, decoded.Description) + } + return decoded.Result, nil +} + +func (c *Client) postJSON(ctx context.Context, method string, params any, result any) error { + body, err := json.Marshal(params) + if err != nil { + return err + } + req, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+"/"+method, bytes.NewReader(body)) + if err != nil { + return err + } + req.Header.Set("Content-Type", "application/json") + resp, err := c.httpClient.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + payload, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) + return fmt.Errorf("%s: telegram returned %s: %s", method, resp.Status, string(payload)) + } + var decoded apiResponse[json.RawMessage] + if err := json.NewDecoder(resp.Body).Decode(&decoded); err != nil { + return err + } + if !decoded.OK { + return fmt.Errorf("%s: telegram error %d: %s", method, decoded.ErrorCode, decoded.Description) + } + if result == nil { + return nil + } + return json.Unmarshal(decoded.Result, result) +} + +type apiResponse[T any] struct { + OK bool `json:"ok"` + Result T `json:"result"` + ErrorCode int `json:"error_code,omitempty"` + Description string `json:"description,omitempty"` +} diff --git a/internal/telegram/bot.go b/internal/telegram/bot.go new file mode 100644 index 0000000..aa3a314 --- /dev/null +++ b/internal/telegram/bot.go @@ -0,0 +1,1760 @@ +package telegram + +import ( + "context" + "database/sql" + "encoding/json" + "errors" + "fmt" + "log" + "mime" + "os" + "path/filepath" + "strconv" + "strings" + "sync" + "time" + + "codex-telegram-bot/internal/codexapp" + "codex-telegram-bot/internal/store" +) + +const ( + telegramDownloadLimit = 20 * 1024 * 1024 + resumeThreadPageSize = 8 + commandSummaryLimit = 120 +) + +type Bot struct { + tg *Client + store *store.Store + codex *codexapp.Client + logger *log.Logger + + uploadDir string + defaultModel string + defaultSandbox string + pollTimeout time.Duration + + mu sync.Mutex + outputs map[string]*outputState + diffs map[string]string +} + +type outputState struct { + chatID int64 + assistant strings.Builder + sentAny bool +} + +type codexThreadItemView struct { + Type string `json:"type"` + ID string `json:"id"` + Command string `json:"command"` + CWD string `json:"cwd"` + Status string `json:"status"` + Tool string `json:"tool"` + Server string `json:"server"` + Namespace string `json:"namespace"` + Query string `json:"query"` + Path string `json:"path"` + SavedPath string `json:"savedPath"` + Text string `json:"text"` + AggregatedOutput *string `json:"aggregatedOutput"` + ExitCode *int `json:"exitCode"` + DurationMs *int64 `json:"durationMs"` + Success *bool `json:"success"` + Arguments json.RawMessage `json:"arguments"` + Changes []struct { + Path string `json:"path"` + } `json:"changes"` +} + +func NewBot(tg *Client, st *store.Store, codex *codexapp.Client, uploadDir, defaultModel, defaultSandbox string, pollTimeout time.Duration, logger *log.Logger) *Bot { + if logger == nil { + logger = log.Default() + } + return &Bot{ + tg: tg, + store: st, + codex: codex, + logger: logger, + uploadDir: uploadDir, + defaultModel: defaultModel, + defaultSandbox: defaultSandbox, + pollTimeout: pollTimeout, + outputs: make(map[string]*outputState), + diffs: make(map[string]string), + } +} + +func (b *Bot) Run(ctx context.Context) error { + if err := b.store.ClearActiveTurns(ctx); err != nil { + return err + } + go b.handleCodexEvents(ctx) + + offset := 0 + for ctx.Err() == nil { + updates, err := b.tg.GetUpdates(ctx, offset, int(b.pollTimeout.Seconds())) + if err != nil { + if ctx.Err() != nil { + break + } + b.logger.Printf("getUpdates: %v", err) + time.Sleep(2 * time.Second) + continue + } + for _, update := range updates { + if update.UpdateID >= offset { + offset = update.UpdateID + 1 + } + if err := b.handleUpdate(ctx, update); err != nil { + b.logger.Printf("handle update %d: %v", update.UpdateID, err) + } + } + } + return ctx.Err() +} + +func (b *Bot) handleUpdate(ctx context.Context, update Update) error { + switch { + case update.Message != nil: + return b.handleMessage(ctx, update.Message) + case update.CallbackQuery != nil: + return b.handleCallback(ctx, update.CallbackQuery) + default: + return nil + } +} + +func (b *Bot) handleMessage(ctx context.Context, message *Message) error { + if message.PinnedMessage != nil { + return nil + } + if message.Chat.Type != "private" { + if message.From != nil { + _ = b.store.Audit(ctx, message.From.ID, "reject_non_private", message.Chat.Type) + } + _, err := b.tg.SendMessage(ctx, message.Chat.ID, "This bot only supports one-to-one chats.", SendMessageOptions{}) + return err + } + if message.From == nil { + return nil + } + allowed, err := b.store.IsAllowed(ctx, message.From.ID) + if err != nil { + return err + } + if !allowed { + _ = b.store.Audit(ctx, message.From.ID, "reject_not_allowed", message.From.Username) + _, err := b.tg.SendMessage(ctx, message.Chat.ID, "Access denied.", SendMessageOptions{}) + return err + } + + session, err := b.store.GetOrCreateSession(ctx, message.From.ID, b.defaultModel, b.defaultSandbox) + if err != nil { + return err + } + if handled, err := b.handleCommand(ctx, message, session); handled || err != nil { + return err + } + return b.continueThread(ctx, message, session) +} + +func (b *Bot) handleCommand(ctx context.Context, message *Message, session store.Session) (bool, error) { + command, args, ok := parseCommand(message.Text) + if !ok { + return false, nil + } + userID := message.From.ID + chatID := message.Chat.ID + + switch command { + case "start", "help": + return true, b.sendHelp(ctx, chatID) + case "new": + _, _, err := b.createNewThread(ctx, userID, chatID, session) + return true, err + case "thread", "threads": + return true, b.sendThreads(ctx, userID, chatID) + case "resume": + return true, b.resumeThread(ctx, userID, chatID, args) + case "fork": + return true, b.forkThread(ctx, userID, chatID, session) + case "archive": + return true, b.archiveThread(ctx, userID, chatID, session, args) + case "status": + return true, b.sendStatus(ctx, userID, chatID, session) + case "cancel": + return true, b.cancelTurn(ctx, userID, chatID, session) + case "workspaces": + return true, b.sendWorkspaces(ctx, chatID) + case "workspace": + return true, b.handleWorkspaceCommand(ctx, userID, chatID, session, args) + case "model": + return true, b.handleModelCommand(ctx, userID, chatID, session, args) + case "sandbox": + return true, b.handleSandboxCommand(ctx, userID, chatID, session, args) + case "diff": + return true, b.sendDiff(ctx, chatID, session) + default: + _, err := b.tg.SendMessage(ctx, chatID, "Unknown command. Use /help.", SendMessageOptions{}) + return true, err + } +} + +func (b *Bot) sendHelp(ctx context.Context, chatID int64) error { + text := strings.Join([]string{ + "Codex Telegram Bot", + "", + "/new - start a new Codex thread", + "/thread or /threads - list recent threads", + "/resume - choose a recent thread", + "/resume ID - resume a thread", + "/fork - fork the active thread", + "/archive [ID] - archive a thread", + "/status - show active settings", + "/cancel - interrupt the active turn", + "/workspaces - list workspaces", + "/workspace [ID] - select workspace", + "/model - choose model and reasoning effort", + "/sandbox [read-only|workspace-write|danger-full-access] - show or set sandbox", + "/diff - show the latest streamed diff", + "", + "Plain text continues the active thread. Images are staged as local Codex image inputs; other files are staged and sent as paths.", + }, "\n") + return b.sendLong(ctx, chatID, text) +} + +func (b *Bot) sendThreads(ctx context.Context, userID, chatID int64) error { + return b.sendResumeChoices(ctx, userID, chatID, 0, 0) +} + +func (b *Bot) resumeThread(ctx context.Context, userID, chatID int64, args []string) error { + if len(args) == 0 { + return b.sendResumeChoices(ctx, userID, chatID, 0, 0) + } + if len(args) != 1 { + _, err := b.tg.SendMessage(ctx, chatID, "Use /resume to choose a thread, or /resume ID to resume directly.", SendMessageOptions{}) + return err + } + id, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + _, sendErr := b.tg.SendMessage(ctx, chatID, "Thread ID must be a number.", SendMessageOptions{}) + return sendErr + } + return b.resumeThreadByID(ctx, userID, chatID, id, 0) +} + +func (b *Bot) sendResumeChoices(ctx context.Context, userID, chatID int64, page int, messageID int) error { + if page < 0 { + page = 0 + } + threads, err := b.store.ListThreadsPage(ctx, userID, false, resumeThreadPageSize+1, page*resumeThreadPageSize) + if err != nil { + return err + } + if len(threads) == 0 && page > 0 { + return b.sendResumeChoices(ctx, userID, chatID, page-1, messageID) + } + if len(threads) == 0 { + text := "No threads yet. Use /new." + if messageID != 0 { + _, err := b.tg.EditMessageText(ctx, chatID, messageID, text, EditMessageTextOptions{}) + return err + } + _, err := b.tg.SendMessage(ctx, chatID, text, SendMessageOptions{}) + return err + } + hasNext := len(threads) > resumeThreadPageSize + if hasNext { + threads = threads[:resumeThreadPageSize] + } + text := resumeThreadListText(threads, page) + markup := resumeThreadMarkup(threads, page, hasNext) + if messageID != 0 { + _, err := b.tg.EditMessageText(ctx, chatID, messageID, EscapeHTML(text), EditMessageTextOptions{ParseMode: "HTML", ReplyMarkup: markup}) + return err + } + _, err = b.tg.SendMessage(ctx, chatID, EscapeHTML(text), SendMessageOptions{ParseMode: "HTML", ReplyMarkup: markup}) + return err +} + +func (b *Bot) resumeThreadByID(ctx context.Context, userID, chatID int64, id int64, messageID int) error { + thread, err := b.store.GetThreadByID(ctx, userID, id) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + text := "Thread not found." + if messageID != 0 { + _, editErr := b.tg.EditMessageText(ctx, chatID, messageID, text, EditMessageTextOptions{}) + return editErr + } + _, sendErr := b.tg.SendMessage(ctx, chatID, text, SendMessageOptions{}) + return sendErr + } + return err + } + if _, err := b.codex.ResumeThread(ctx, thread.CodexThreadID); err != nil { + return b.sendError(ctx, chatID, "Could not resume Codex thread", err) + } + if err := b.store.SetActiveThread(ctx, userID, thread.ID); err != nil { + return err + } + text := fmt.Sprintf("Active thread ID %d: %s", thread.ID, threadDisplayTitle(thread)) + if messageID != 0 { + _, err = b.tg.EditMessageText(ctx, chatID, messageID, EscapeHTML(text), EditMessageTextOptions{ParseMode: "HTML"}) + return err + } + _, err = b.tg.SendMessage(ctx, chatID, EscapeHTML(text), SendMessageOptions{ParseMode: "HTML"}) + return err +} + +func (b *Bot) forkThread(ctx context.Context, userID, chatID int64, session store.Session) error { + thread, err := b.activeThread(ctx, userID, session) + if err != nil { + return b.sendNoActiveThread(ctx, chatID, err) + } + forked, err := b.codex.ForkThread(ctx, thread.CodexThreadID) + if err != nil { + return b.sendError(ctx, chatID, "Could not fork Codex thread", err) + } + local, err := b.store.CreateThread(ctx, userID, forked.ID, thread.WorkspaceID, "fork of #"+strconv.FormatInt(thread.ID, 10)) + if err != nil { + return err + } + if err := b.store.SetActiveThread(ctx, userID, local.ID); err != nil { + return err + } + _, err = b.tg.SendMessage(ctx, chatID, fmt.Sprintf("Forked active thread to #%d.", local.ID), SendMessageOptions{}) + return err +} + +func (b *Bot) archiveThread(ctx context.Context, userID, chatID int64, session store.Session, args []string) error { + var thread store.Thread + var err error + if len(args) > 0 { + id, parseErr := strconv.ParseInt(args[0], 10, 64) + if parseErr != nil { + _, sendErr := b.tg.SendMessage(ctx, chatID, "Thread ID must be a number.", SendMessageOptions{}) + return sendErr + } + thread, err = b.store.GetThreadByID(ctx, userID, id) + } else { + thread, err = b.activeThread(ctx, userID, session) + } + if err != nil { + return b.sendNoActiveThread(ctx, chatID, err) + } + if err := b.codex.ArchiveThread(ctx, thread.CodexThreadID); err != nil { + return b.sendError(ctx, chatID, "Could not archive Codex thread", err) + } + if err := b.store.ArchiveThread(ctx, userID, thread.ID); err != nil { + return err + } + _, err = b.tg.SendMessage(ctx, chatID, fmt.Sprintf("Archived thread #%d.", thread.ID), SendMessageOptions{}) + return err +} + +func (b *Bot) sendStatus(ctx context.Context, userID, chatID int64, session store.Session) error { + workspace := "(none)" + if session.ActiveWorkspaceID != 0 { + if ws, err := b.store.GetWorkspaceByID(ctx, session.ActiveWorkspaceID); err == nil { + workspace = fmt.Sprintf("%s (%s)", ws.Label, ws.Path) + } + } + thread := "(none)" + if session.ActiveThreadID != 0 { + thread = fmt.Sprintf("#%d", session.ActiveThreadID) + } + model := session.Model + if model == "" { + model = "(Codex default)" + } + turn := session.ActiveTurnID + if turn == "" { + turn = "(none)" + } + effort := session.ReasoningEffort + if effort == "" { + effort = "(model default)" + } + text := fmt.Sprintf("Workspace: %s\nThread: %s\nModel: %s\nReasoning effort: %s\nSandbox: %s\nActive turn: %s", workspace, thread, model, effort, session.Sandbox, turn) + _ = userID + return b.sendLong(ctx, chatID, text) +} + +func (b *Bot) cancelTurn(ctx context.Context, userID, chatID int64, session store.Session) error { + if session.ActiveTurnID == "" { + _, err := b.tg.SendMessage(ctx, chatID, "No active turn to cancel.", SendMessageOptions{}) + return err + } + thread, err := b.activeThread(ctx, userID, session) + if err != nil { + return b.sendNoActiveThread(ctx, chatID, err) + } + if err := b.codex.InterruptTurn(ctx, thread.CodexThreadID, session.ActiveTurnID); err != nil { + return b.sendError(ctx, chatID, "Could not interrupt turn", err) + } + _, err = b.tg.SendMessage(ctx, chatID, "Cancellation requested.", SendMessageOptions{}) + return err +} + +func (b *Bot) sendWorkspaces(ctx context.Context, chatID int64) error { + workspaces, err := b.store.ListWorkspaces(ctx) + if err != nil { + return err + } + if len(workspaces) == 0 { + _, err := b.tg.SendMessage(ctx, chatID, "No workspaces configured. Ask an admin to run scripts/add-workspace.", SendMessageOptions{}) + return err + } + var lines []string + lines = append(lines, "Workspaces:") + for _, ws := range workspaces { + marker := "" + if ws.IsDefault { + marker = " default" + } + lines = append(lines, fmt.Sprintf("#%d %s%s\n%s", ws.ID, ws.Label, marker, ws.Path)) + } + _, err = b.tg.SendMessage(ctx, chatID, EscapeHTML(strings.Join(lines, "\n")), SendMessageOptions{ + ParseMode: "HTML", + ReplyMarkup: workspaceMarkup(workspaces), + }) + return err +} + +func (b *Bot) handleWorkspaceCommand(ctx context.Context, userID, chatID int64, session store.Session, args []string) error { + if len(args) == 0 { + return b.sendWorkspaces(ctx, chatID) + } + id, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + _, sendErr := b.tg.SendMessage(ctx, chatID, "Workspace ID must be a number.", SendMessageOptions{}) + return sendErr + } + return b.setWorkspace(ctx, userID, chatID, session, id) +} + +func (b *Bot) setWorkspace(ctx context.Context, userID, chatID int64, session store.Session, workspaceID int64) error { + workspace, err := b.store.GetWorkspaceByID(ctx, workspaceID) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + _, sendErr := b.tg.SendMessage(ctx, chatID, "Workspace not found.", SendMessageOptions{}) + return sendErr + } + return err + } + if err := b.store.SetSessionWorkspace(ctx, userID, workspace.ID); err != nil { + return err + } + _ = session + _, err = b.tg.SendMessage(ctx, chatID, "Workspace set to "+workspace.Label+".", SendMessageOptions{}) + return err +} + +func (b *Bot) handleModelCommand(ctx context.Context, userID, chatID int64, session store.Session, args []string) error { + _ = userID + if len(args) > 0 { + _, err := b.tg.SendMessage(ctx, chatID, "Use /model and choose from the buttons.", SendMessageOptions{}) + return err + } + return b.sendModelChoices(ctx, chatID, session) +} + +func (b *Bot) sendModelChoices(ctx context.Context, chatID int64, session store.Session) error { + models, err := b.codex.ListModels(ctx) + if err != nil { + return b.sendError(ctx, chatID, "Could not list Codex models", err) + } + if len(models) == 0 { + _, err := b.tg.SendMessage(ctx, chatID, "Codex returned no available models.", SendMessageOptions{}) + return err + } + model := sessionModelLabel(models, session.Model) + text := settingsStatusText(model, session.ReasoningEffort) + "\nChoose a model:" + message, err := b.tg.SendMessage(ctx, chatID, EscapeHTML(text), SendMessageOptions{ + ParseMode: "HTML", + ReplyMarkup: modelMarkup(models), + }) + if err != nil { + return err + } + b.rememberSettingsMessage(ctx, session.TelegramUserID, chatID, message.MessageID) + return nil +} + +func (b *Bot) handleModelCallback(ctx context.Context, callback *CallbackQuery, modelID string) error { + models, err := b.codex.ListModels(ctx) + if err != nil { + _ = b.tg.AnswerCallbackQuery(ctx, callback.ID, "Could not list models.") + return b.sendError(ctx, callback.Message.Chat.ID, "Could not list Codex models", err) + } + var selected codexapp.Model + found := false + for _, model := range models { + if model.ID == modelID { + selected = model + found = true + break + } + } + if !found { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Model is no longer available.") + } + if err := b.store.SetSessionModel(ctx, callback.From.ID, selected.ID); err != nil { + return err + } + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, "Model selected."); err != nil { + return err + } + label := modelLabel(selected) + if len(selected.SupportedReasoningEfforts) == 0 { + text := settingsStatusText(label, "") + "\nNo reasoning effort choices are advertised for this model." + message, err := b.tg.EditMessageText(ctx, callback.Message.Chat.ID, callback.Message.MessageID, EscapeHTML(text), EditMessageTextOptions{ParseMode: "HTML"}) + if err == nil { + b.rememberSettingsMessage(ctx, callback.From.ID, callback.Message.Chat.ID, message.MessageID) + } + return err + } + text := settingsStatusText(label, "") + "\nChoose reasoning effort:" + message, err := b.tg.EditMessageText(ctx, callback.Message.Chat.ID, callback.Message.MessageID, EscapeHTML(text), EditMessageTextOptions{ + ParseMode: "HTML", + ReplyMarkup: effortMarkup(selected), + }) + if err == nil { + b.rememberSettingsMessage(ctx, callback.From.ID, callback.Message.Chat.ID, message.MessageID) + } + return err +} + +func (b *Bot) handleEffortCallback(ctx context.Context, callback *CallbackQuery, effort string) error { + session, err := b.store.GetOrCreateSession(ctx, callback.From.ID, b.defaultModel, b.defaultSandbox) + if err != nil { + return err + } + if session.Model == "" { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Choose a model first.") + } + models, err := b.codex.ListModels(ctx) + if err != nil { + _ = b.tg.AnswerCallbackQuery(ctx, callback.ID, "Could not validate effort.") + return b.sendError(ctx, callback.Message.Chat.ID, "Could not list Codex models", err) + } + var selected codexapp.Model + found := false + for _, model := range models { + if model.ID == session.Model { + selected = model + found = true + break + } + } + if !found { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Selected model is no longer available.") + } + if !modelSupportsEffort(selected, effort) { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Effort is no longer available for this model.") + } + if err := b.store.SetSessionReasoningEffort(ctx, callback.From.ID, effort); err != nil { + return err + } + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, "Reasoning effort selected."); err != nil { + return err + } + text := settingsStatusText(modelLabel(selected), effort) + message, err := b.tg.EditMessageText(ctx, callback.Message.Chat.ID, callback.Message.MessageID, EscapeHTML(text), EditMessageTextOptions{ParseMode: "HTML"}) + if err == nil { + b.rememberSettingsMessage(ctx, callback.From.ID, callback.Message.Chat.ID, message.MessageID) + } + return err +} + +func (b *Bot) handleSandboxCommand(ctx context.Context, userID, chatID int64, session store.Session, args []string) error { + if len(args) == 0 { + _, err := b.tg.SendMessage(ctx, chatID, "Current sandbox: "+session.Sandbox, SendMessageOptions{}) + return err + } + sandbox, err := codexapp.NormalizeSandbox(args[0]) + if err != nil { + _, sendErr := b.tg.SendMessage(ctx, chatID, "Use one of: read-only, workspace-write, danger-full-access.", SendMessageOptions{}) + return sendErr + } + if err := b.store.SetSessionSandbox(ctx, userID, sandbox); err != nil { + return err + } + _, err = b.tg.SendMessage(ctx, chatID, "Sandbox set to "+sandbox+".", SendMessageOptions{}) + return err +} + +func (b *Bot) sendDiff(ctx context.Context, chatID int64, session store.Session) error { + if session.ActiveThreadID == 0 { + _, err := b.tg.SendMessage(ctx, chatID, "No active thread.", SendMessageOptions{}) + return err + } + thread, err := b.store.GetThreadByID(ctx, chatID, session.ActiveThreadID) + if err != nil { + _, sendErr := b.tg.SendMessage(ctx, chatID, "No active thread.", SendMessageOptions{}) + return sendErr + } + b.mu.Lock() + diff := b.diffs[thread.CodexThreadID] + b.mu.Unlock() + if diff == "" { + _, err := b.tg.SendMessage(ctx, chatID, "No diff has been streamed for this thread.", SendMessageOptions{}) + return err + } + return b.sendLong(ctx, chatID, diff) +} + +func (b *Bot) continueThread(ctx context.Context, message *Message, session store.Session) error { + userID := message.From.ID + chatID := message.Chat.ID + input, err := b.messageInput(ctx, userID, message) + if err != nil { + return b.sendError(ctx, chatID, "Could not stage Telegram input", err) + } + if len(input) == 0 { + _, err := b.tg.SendMessage(ctx, chatID, "Send text, an image, or a document.", SendMessageOptions{}) + return err + } + + thread, workspace, err := b.ensureThread(ctx, userID, chatID, session) + if err != nil { + return err + } + if session.ActiveTurnID != "" { + if err := b.codex.SteerTurn(ctx, thread.CodexThreadID, session.ActiveTurnID, input); err != nil { + return b.sendError(ctx, chatID, "Could not append to active turn", err) + } + _, err := b.tg.SendMessage(ctx, chatID, "Added to the running turn.", SendMessageOptions{}) + return err + } + + b.registerOutput(thread.CodexThreadID, chatID) + turn, err := b.codex.StartTurn(ctx, thread.CodexThreadID, workspace.Path, session.Model, session.ReasoningEffort, session.Sandbox, input) + if err != nil { + b.clearOutput(thread.CodexThreadID) + return b.sendError(ctx, chatID, "Codex turn failed", err) + } + if err := b.store.SetActiveTurn(ctx, userID, turn.ID); err != nil { + return err + } + _ = b.store.TouchThread(ctx, thread.CodexThreadID) + return nil +} + +func (b *Bot) createNewThread(ctx context.Context, userID, chatID int64, session store.Session) (store.Thread, store.Workspace, error) { + workspace, err := b.resolveWorkspace(ctx, userID, session) + if err != nil { + return store.Thread{}, store.Workspace{}, b.sendWorkspaceMissing(ctx, chatID) + } + codexThread, err := b.codex.StartThread(ctx, workspace.Path, session.Model, session.Sandbox) + if err != nil { + return store.Thread{}, store.Workspace{}, b.sendError(ctx, chatID, "Could not start Codex thread", err) + } + title := codexThread.Preview + if title == "" { + title = workspace.Label + } + thread, err := b.store.CreateThread(ctx, userID, codexThread.ID, workspace.ID, title) + if err != nil { + return store.Thread{}, store.Workspace{}, err + } + if err := b.store.SetActiveThread(ctx, userID, thread.ID); err != nil { + return store.Thread{}, store.Workspace{}, err + } + _, err = b.tg.SendMessage(ctx, chatID, fmt.Sprintf("New thread #%d in %s.", thread.ID, workspace.Label), SendMessageOptions{}) + return thread, workspace, err +} + +func (b *Bot) ensureThread(ctx context.Context, userID, chatID int64, session store.Session) (store.Thread, store.Workspace, error) { + if session.ActiveThreadID != 0 { + thread, err := b.store.GetThreadByID(ctx, userID, session.ActiveThreadID) + if err == nil && !thread.Archived { + workspace, err := b.store.GetWorkspaceByID(ctx, thread.WorkspaceID) + return thread, workspace, err + } + } + return b.createNewThread(ctx, userID, chatID, session) +} + +func (b *Bot) activeThread(ctx context.Context, userID int64, session store.Session) (store.Thread, error) { + if session.ActiveThreadID == 0 { + return store.Thread{}, sql.ErrNoRows + } + return b.store.GetThreadByID(ctx, userID, session.ActiveThreadID) +} + +func (b *Bot) resolveWorkspace(ctx context.Context, userID int64, session store.Session) (store.Workspace, error) { + if session.ActiveWorkspaceID != 0 { + return b.store.GetWorkspaceByID(ctx, session.ActiveWorkspaceID) + } + workspace, err := b.store.DefaultWorkspace(ctx) + if err != nil { + return store.Workspace{}, err + } + if err := b.store.SetSessionWorkspace(ctx, userID, workspace.ID); err != nil { + return store.Workspace{}, err + } + return workspace, nil +} + +func (b *Bot) messageInput(ctx context.Context, userID int64, message *Message) ([]codexapp.InputItem, error) { + var input []codexapp.InputItem + text := strings.TrimSpace(message.Text) + if text == "" { + text = strings.TrimSpace(message.Caption) + } + if text != "" { + input = append(input, codexapp.InputItem{Type: "text", Text: text}) + } + if len(message.Photo) > 0 { + photo := largestPhoto(message.Photo) + path, err := b.stageFile(ctx, userID, photo.FileID, "photo.jpg", "image/jpeg", photo.FileSize) + if err != nil { + return nil, err + } + input = append(input, codexapp.InputItem{Type: "localImage", Path: path}) + } + if message.Document != nil { + path, err := b.stageFile(ctx, userID, message.Document.FileID, message.Document.FileName, message.Document.MimeType, message.Document.FileSize) + if err != nil { + return nil, err + } + if isImage(message.Document.MimeType, message.Document.FileName) { + input = append(input, codexapp.InputItem{Type: "localImage", Path: path}) + } else { + input = append(input, codexapp.InputItem{Type: "text", Text: "User uploaded a file staged at: " + path}) + } + } + return input, nil +} + +func (b *Bot) stageFile(ctx context.Context, userID int64, fileID, filename, mimeType string, size int64) (string, error) { + if size > telegramDownloadLimit { + return "", fmt.Errorf("file exceeds Telegram cloud download limit of 20 MB") + } + file, err := b.tg.GetFile(ctx, fileID) + if err != nil { + return "", err + } + if file.FileSize > telegramDownloadLimit { + return "", fmt.Errorf("file exceeds Telegram cloud download limit of 20 MB") + } + if file.FilePath == "" { + return "", errors.New("telegram did not return a file path") + } + data, err := b.tg.DownloadFilePath(ctx, file.FilePath) + if err != nil { + return "", err + } + if len(data) > telegramDownloadLimit { + return "", fmt.Errorf("file exceeds Telegram cloud download limit of 20 MB") + } + if filename == "" { + filename = filepath.Base(file.FilePath) + } + if filename == "." || filename == string(filepath.Separator) || filename == "" { + filename = fileID + if ext := extensionForMime(mimeType); ext != "" { + filename += ext + } + } + if err := os.MkdirAll(b.uploadDir, 0o755); err != nil { + return "", err + } + name := fmt.Sprintf("%d_%d_%s", userID, time.Now().UnixNano(), safeFilename(filename)) + path := filepath.Join(b.uploadDir, name) + if err := os.WriteFile(path, data, 0o644); err != nil { + return "", err + } + return path, nil +} + +func (b *Bot) handleCallback(ctx context.Context, callback *CallbackQuery) error { + if callback.Message == nil { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Unsupported callback.") + } + if callback.Message.Chat.Type != "private" { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Use a private chat.") + } + allowed, err := b.store.IsAllowed(ctx, callback.From.ID) + if err != nil { + return err + } + if !allowed { + _ = b.store.Audit(ctx, callback.From.ID, "reject_callback_not_allowed", callback.From.Username) + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Access denied.") + } + session, err := b.store.GetOrCreateSession(ctx, callback.From.ID, b.defaultModel, b.defaultSandbox) + if err != nil { + return err + } + if workspaceID, ok := ParseWorkspaceCallbackData(callback.Data); ok { + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, ""); err != nil { + return err + } + return b.setWorkspace(ctx, callback.From.ID, callback.Message.Chat.ID, session, workspaceID) + } + if resumeID, ok := ParseResumeThreadCallbackData(callback.Data); ok { + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, "Thread selected."); err != nil { + return err + } + return b.resumeThreadByID(ctx, callback.From.ID, callback.Message.Chat.ID, resumeID, callback.Message.MessageID) + } + if resumePage, ok := ParseResumePageCallbackData(callback.Data); ok { + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, ""); err != nil { + return err + } + return b.sendResumeChoices(ctx, callback.From.ID, callback.Message.Chat.ID, resumePage, callback.Message.MessageID) + } + if modelID, ok := ParseModelCallbackData(callback.Data); ok { + return b.handleModelCallback(ctx, callback, modelID) + } + if effort, ok := ParseEffortCallbackData(callback.Data); ok { + return b.handleEffortCallback(ctx, callback, effort) + } + if approvalID, decision, ok := ParseApprovalCallbackData(callback.Data); ok { + return b.handleApprovalCallback(ctx, callback, approvalID, decision) + } + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Unknown action.") +} + +func (b *Bot) handleApprovalCallback(ctx context.Context, callback *CallbackQuery, approvalID int64, decision string) error { + approval, err := b.store.GetPendingApproval(ctx, callback.From.ID, approvalID) + if err != nil { + _ = b.tg.AnswerCallbackQuery(ctx, callback.ID, "Approval not found.") + return nil + } + if decision == "details" { + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, "Details sent."); err != nil { + return err + } + return b.sendLong(ctx, callback.Message.Chat.ID, approval.PayloadJSON) + } + if approval.Status != "pending" { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Already resolved.") + } + requestID, err := strconv.ParseInt(approval.CodexRequestID, 10, 64) + if err != nil { + return b.tg.AnswerCallbackQuery(ctx, callback.ID, "Invalid request id.") + } + if err := b.codex.RespondServerRequest(ctx, requestID, approvalResponse(approval, decision)); err != nil { + _ = b.tg.AnswerCallbackQuery(ctx, callback.ID, "Could not answer Codex.") + return b.sendError(ctx, callback.Message.Chat.ID, "Could not answer Codex approval", err) + } + if err := b.store.ResolvePendingApproval(ctx, callback.From.ID, approval.ID, decision); err != nil { + return err + } + if err := b.tg.AnswerCallbackQuery(ctx, callback.ID, "Sent to Codex."); err != nil { + return err + } + updated := renderApprovalHTML(approval.Kind, json.RawMessage(approval.PayloadJSON), approvalStatusLine(decision)) + _, err = b.tg.EditMessageText(ctx, callback.Message.Chat.ID, callback.Message.MessageID, updated, EditMessageTextOptions{ParseMode: "HTML"}) + return err +} + +func (b *Bot) handleCodexEvents(ctx context.Context) { + for { + select { + case <-ctx.Done(): + return + case event := <-b.codex.Events(): + if event.Err != nil { + b.logger.Printf("codex event %s: %v", event.Method, event.Err) + if event.Method == "connection/closed" { + b.failActiveOutputs(ctx, "Codex connection closed: "+event.Err.Error()) + } + continue + } + if event.ServerRequest { + if err := b.handleCodexServerRequest(ctx, event); err != nil { + b.logger.Printf("server request %s: %v", event.Method, err) + } + continue + } + if err := b.handleCodexNotification(ctx, event); err != nil { + b.logger.Printf("notification %s: %v", event.Method, err) + } + } + } +} + +func parseCodexThreadItem(raw json.RawMessage) (codexThreadItemView, error) { + var item codexThreadItemView + if len(raw) == 0 { + return item, nil + } + if err := json.Unmarshal(raw, &item); err != nil { + return item, err + } + return item, nil +} + +func renderCodexItemStarted(item codexThreadItemView) string { + switch item.Type { + case "commandExecution": + return SummaryDetailsHTMLLimited(joinNonEmpty("Tool call: command started", commandSummaryLine(item.Command)), commandStartedDetails(item), TelegramHTMLMessageLimit) + case "fileChange": + return "Tool call: file change started" + case "mcpToolCall": + return joinNonEmpty("Tool call: MCP started", "Tool: "+toolDisplayName(item.Server, item.Tool)) + case "dynamicToolCall": + return joinNonEmpty("Tool call: started", "Tool: "+toolDisplayName(item.Namespace, item.Tool)) + case "webSearch": + return joinNonEmpty("Tool call: web search started", "Query: "+item.Query) + case "imageView": + return joinNonEmpty("Tool call: image view", "Path: "+item.Path) + case "imageGeneration": + return "Tool call: image generation started" + case "collabAgentToolCall": + return joinNonEmpty("Tool call: agent started", "Tool: "+item.Tool) + default: + return "" + } +} + +func renderCodexItemCompleted(item codexThreadItemView) string { + switch item.Type { + case "commandExecution": + status := "" + if item.ExitCode != nil { + status = fmt.Sprintf("Exit code: %d", *item.ExitCode) + } + return SummaryDetailsHTMLLimited(joinNonEmpty("Tool call: command finished", commandSummaryLine(item.Command), status), renderCodexItemDetails(item), TelegramHTMLMessageLimit) + case "fileChange": + return joinNonEmpty("Tool call: file change finished", fmt.Sprintf("Changed files: %d", len(item.Changes)), "Status: "+item.Status) + case "mcpToolCall": + return joinNonEmpty("Tool call: MCP finished", "Tool: "+toolDisplayName(item.Server, item.Tool), "Status: "+item.Status) + case "dynamicToolCall": + status := item.Status + if item.Success != nil { + status = fmt.Sprintf("success=%t", *item.Success) + } + return joinNonEmpty("Tool call: finished", "Tool: "+toolDisplayName(item.Namespace, item.Tool), "Status: "+status) + case "webSearch": + return joinNonEmpty("Tool call: web search finished", "Query: "+item.Query) + case "imageView": + return joinNonEmpty("Tool call: image view finished", "Path: "+item.Path) + case "imageGeneration": + return joinNonEmpty("Tool call: image generation finished", "Status: "+item.Status, "Saved path: "+item.SavedPath) + case "collabAgentToolCall": + return joinNonEmpty("Tool call: agent finished", "Tool: "+item.Tool, "Status: "+item.Status) + default: + return "" + } +} + +func commandSummaryLine(command string) string { + command = strings.TrimSpace(command) + if command == "" { + return "" + } + runes := []rune(command) + if len(runes) <= commandSummaryLimit { + return "Command: " + command + } + return "Command: " + string(runes[:commandSummaryLimit]) + "..." +} + +func commandStartedDetails(item codexThreadItemView) string { + var lines []string + if strings.TrimSpace(item.Command) != "" && len([]rune(strings.TrimSpace(item.Command))) > commandSummaryLimit { + lines = append(lines, "command: "+strings.TrimSpace(item.Command)) + } + if strings.TrimSpace(item.CWD) != "" { + lines = append(lines, "cwd: "+strings.TrimSpace(item.CWD)) + } + return strings.Join(lines, "\n") +} + +func renderCodexItemDetails(item codexThreadItemView) string { + var lines []string + appendKV := func(key string, value any) { + switch v := value.(type) { + case string: + if strings.TrimSpace(v) != "" { + lines = append(lines, fmt.Sprintf("%s: %s", key, v)) + } + case *int: + if v != nil { + lines = append(lines, fmt.Sprintf("%s: %d", key, *v)) + } + case *int64: + if v != nil { + lines = append(lines, fmt.Sprintf("%s: %d", key, *v)) + } + case *bool: + if v != nil { + lines = append(lines, fmt.Sprintf("%s: %t", key, *v)) + } + } + } + appendKV("type", item.Type) + appendKV("id", item.ID) + appendKV("command", item.Command) + appendKV("cwd", item.CWD) + appendKV("status", item.Status) + appendKV("tool", toolDisplayName(item.Namespace, item.Tool)) + appendKV("server", item.Server) + appendKV("query", item.Query) + appendKV("path", item.Path) + appendKV("savedPath", item.SavedPath) + appendKV("exitCode", item.ExitCode) + appendKV("durationMs", item.DurationMs) + appendKV("success", item.Success) + if len(item.Arguments) > 0 && string(item.Arguments) != "null" { + lines = append(lines, "arguments: "+string(item.Arguments)) + } + if len(item.Changes) > 0 { + for _, change := range item.Changes { + if change.Path != "" { + lines = append(lines, "changed: "+change.Path) + } + } + } + if item.AggregatedOutput != nil && strings.TrimSpace(*item.AggregatedOutput) != "" { + lines = append(lines, "output:\n"+strings.TrimSpace(*item.AggregatedOutput)) + } + return strings.Join(lines, "\n") +} + +func joinNonEmpty(lines ...string) string { + out := make([]string, 0, len(lines)) + for _, line := range lines { + if strings.TrimSpace(line) != "" { + out = append(out, line) + } + } + return strings.Join(out, "\n") +} + +func toolDisplayName(namespace, tool string) string { + if namespace == "" { + return tool + } + if tool == "" { + return namespace + } + return namespace + "." + tool +} + +func truncateForStatus(text string) string { + runes := []rune(text) + if len(runes) <= 1200 { + return text + } + return string(runes[:1200]) + "\n..." +} + +func (b *Bot) handleCodexNotification(ctx context.Context, event codexapp.Event) error { + switch event.Method { + case "error": + var params struct { + ThreadID string `json:"threadId"` + TurnID string `json:"turnId"` + WillRetry bool `json:"willRetry"` + Error struct { + Message string `json:"message"` + AdditionalDetails string `json:"additionalDetails"` + } `json:"error"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + if params.ThreadID != "" && !params.WillRetry { + if thread, err := b.store.GetThreadByCodexID(ctx, params.ThreadID); err == nil { + _ = b.store.SetActiveTurn(ctx, thread.TelegramUserID, "") + } + message := "Codex error" + if params.Error.Message != "" { + message += ": " + params.Error.Message + } + if params.Error.AdditionalDetails != "" { + message += "\n" + params.Error.AdditionalDetails + } + if err := b.flushAssistantMessage(ctx, params.ThreadID); err != nil { + return err + } + if err := b.sendOutputBlock(ctx, params.ThreadID, message); err != nil { + return err + } + b.clearOutput(params.ThreadID) + return nil + } + case "item/started": + var params struct { + ThreadID string `json:"threadId"` + Item json.RawMessage `json:"item"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + item, err := parseCodexThreadItem(params.Item) + if err != nil { + return err + } + if params.ThreadID != "" && item.Type == "agentMessage" && b.hasAssistantText(params.ThreadID) { + return b.flushAssistantMessage(ctx, params.ThreadID) + } + if params.ThreadID != "" { + return b.sendOutputHTMLBlock(ctx, params.ThreadID, renderCodexItemStarted(item)) + } + case "item/agentMessage/delta": + var params struct { + ThreadID string `json:"threadId"` + Delta string `json:"delta"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + if params.ThreadID != "" && params.Delta != "" { + return b.appendAssistantDelta(ctx, params.ThreadID, params.Delta) + } + case "item/completed": + var params struct { + ThreadID string `json:"threadId"` + Item json.RawMessage `json:"item"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + item, err := parseCodexThreadItem(params.Item) + if err != nil { + return err + } + if params.ThreadID != "" && item.Type == "agentMessage" { + if item.Text != "" && !b.hasAssistantText(params.ThreadID) { + if err := b.appendAssistantDelta(ctx, params.ThreadID, item.Text); err != nil { + return err + } + } + return b.flushAssistantMessage(ctx, params.ThreadID) + } + if params.ThreadID != "" { + return b.sendOutputHTMLBlock(ctx, params.ThreadID, renderCodexItemCompleted(item)) + } + case "turn/diff/updated": + var params struct { + ThreadID string `json:"threadId"` + Diff string `json:"diff"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + if params.ThreadID != "" { + b.mu.Lock() + b.diffs[params.ThreadID] = params.Diff + b.mu.Unlock() + } + case "turn/completed": + var params struct { + ThreadID string `json:"threadId"` + Turn struct { + ID string `json:"id"` + Status string `json:"status"` + } `json:"turn"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + if params.ThreadID != "" { + if thread, err := b.store.GetThreadByCodexID(ctx, params.ThreadID); err == nil { + _ = b.store.SetActiveTurn(ctx, thread.TelegramUserID, "") + _ = b.store.TouchThread(ctx, params.ThreadID) + } + return b.completeTurnOutput(ctx, params.ThreadID) + } + case "serverRequest/resolved": + var params struct { + ThreadID string `json:"threadId"` + RequestID string `json:"requestId"` + } + _ = json.Unmarshal(event.Params, ¶ms) + } + return nil +} + +func (b *Bot) handleCodexServerRequest(ctx context.Context, event codexapp.Event) error { + if event.ID == nil { + return nil + } + switch event.Method { + case "item/commandExecution/requestApproval", "item/fileChange/requestApproval", "item/permissions/requestApproval": + default: + b.logger.Printf("unhandled server request: %s", event.Method) + return nil + } + var params struct { + ThreadID string `json:"threadId"` + TurnID string `json:"turnId"` + ItemID string `json:"itemId"` + Reason string `json:"reason"` + } + if err := json.Unmarshal(event.Params, ¶ms); err != nil { + return err + } + if params.ThreadID == "" { + return errors.New("approval request missing threadId") + } + thread, err := b.store.GetThreadByCodexID(ctx, params.ThreadID) + if err != nil { + return err + } + pretty, _ := json.MarshalIndent(json.RawMessage(event.Params), "", " ") + if len(pretty) == 0 { + pretty = event.Params + } + kind := event.Method + approval, err := b.store.UpsertPendingApproval(ctx, store.PendingApproval{ + TelegramUserID: thread.TelegramUserID, + CodexRequestID: strconv.FormatInt(*event.ID, 10), + CodexThreadID: params.ThreadID, + TurnID: params.TurnID, + ItemID: params.ItemID, + Kind: kind, + PayloadJSON: string(pretty), + }) + if err != nil { + return err + } + text := renderApprovalHTML(kind, event.Params, "") + msg, err := b.tg.SendMessage(ctx, thread.TelegramUserID, text, SendMessageOptions{ + ParseMode: "HTML", + ReplyMarkup: approvalMarkup(approval.ID), + }) + if err != nil { + return err + } + return b.store.UpdatePendingApprovalMessage(ctx, approval.ID, msg.Chat.ID, msg.MessageID) +} + +func (b *Bot) registerOutput(threadID string, chatID int64) { + b.mu.Lock() + defer b.mu.Unlock() + b.outputs[threadID] = &outputState{chatID: chatID} +} + +func (b *Bot) clearOutput(threadID string) { + b.mu.Lock() + defer b.mu.Unlock() + delete(b.outputs, threadID) +} + +func (b *Bot) hasAssistantText(threadID string) bool { + b.mu.Lock() + defer b.mu.Unlock() + state := b.outputs[threadID] + return state != nil && state.assistant.Len() > 0 +} + +func (b *Bot) failActiveOutputs(ctx context.Context, message string) { + b.mu.Lock() + threadIDs := make([]string, 0, len(b.outputs)) + for threadID := range b.outputs { + threadIDs = append(threadIDs, threadID) + } + b.mu.Unlock() + + for _, threadID := range threadIDs { + if thread, err := b.store.GetThreadByCodexID(ctx, threadID); err == nil { + _ = b.store.SetActiveTurn(ctx, thread.TelegramUserID, "") + } + if err := b.flushAssistantMessage(ctx, threadID); err != nil { + b.logger.Printf("flush failed output %s: %v", threadID, err) + } + if err := b.sendOutputBlock(ctx, threadID, message); err != nil { + b.logger.Printf("send failed output %s: %v", threadID, err) + } + b.clearOutput(threadID) + } +} + +func (b *Bot) sendOutputBlock(ctx context.Context, threadID, block string) error { + block = strings.TrimSpace(block) + if block == "" { + return nil + } + if err := b.flushAssistantMessage(ctx, threadID); err != nil { + return err + } + chatID, err := b.outputChatID(ctx, threadID) + if err != nil { + return nil + } + if err := b.sendLong(ctx, chatID, block); err != nil { + return err + } + b.markOutputSent(threadID) + return nil +} + +func (b *Bot) sendOutputHTMLBlock(ctx context.Context, threadID, htmlText string) error { + htmlText = strings.TrimSpace(htmlText) + if htmlText == "" { + return nil + } + if err := b.flushAssistantMessage(ctx, threadID); err != nil { + return err + } + chatID, err := b.outputChatID(ctx, threadID) + if err != nil { + return nil + } + if err := b.sendHTML(ctx, chatID, htmlText); err != nil { + return err + } + b.markOutputSent(threadID) + return nil +} + +func (b *Bot) appendAssistantDelta(ctx context.Context, threadID, delta string) error { + if delta == "" { + return nil + } + if _, err := b.outputChatID(ctx, threadID); err != nil { + return nil + } + b.mu.Lock() + state := b.outputs[threadID] + if state != nil { + _, _ = state.assistant.WriteString(delta) + } + b.mu.Unlock() + return nil +} + +func (b *Bot) flushAssistantMessage(ctx context.Context, threadID string) error { + b.mu.Lock() + state := b.outputs[threadID] + if state == nil || state.assistant.Len() == 0 { + b.mu.Unlock() + return nil + } + chatID := state.chatID + text := state.assistant.String() + state.assistant.Reset() + b.mu.Unlock() + + if err := b.sendLong(ctx, chatID, text); err != nil { + return err + } + b.markOutputSent(threadID) + return nil +} + +func (b *Bot) completeTurnOutput(ctx context.Context, threadID string) error { + if err := b.flushAssistantMessage(ctx, threadID); err != nil { + return err + } + b.mu.Lock() + state := b.outputs[threadID] + if state == nil { + b.mu.Unlock() + return nil + } + chatID := state.chatID + sentAny := state.sentAny + delete(b.outputs, threadID) + b.mu.Unlock() + + if !sentAny { + _, err := b.tg.SendMessage(ctx, chatID, "Done.", SendMessageOptions{}) + return err + } + return nil +} + +func (b *Bot) outputChatID(ctx context.Context, threadID string) (int64, error) { + b.mu.Lock() + state := b.outputs[threadID] + if state != nil { + chatID := state.chatID + b.mu.Unlock() + return chatID, nil + } + b.mu.Unlock() + + thread, err := b.store.GetThreadByCodexID(ctx, threadID) + if err != nil { + return 0, err + } + b.registerOutput(threadID, thread.TelegramUserID) + return thread.TelegramUserID, nil +} + +func (b *Bot) markOutputSent(threadID string) { + b.mu.Lock() + defer b.mu.Unlock() + if state := b.outputs[threadID]; state != nil { + state.sentAny = true + } +} + +func (b *Bot) sendLong(ctx context.Context, chatID int64, text string) error { + for _, chunk := range ChunkText(text, TelegramHTMLMessageLimit) { + if err := b.sendHTML(ctx, chatID, EscapeHTML(chunk)); err != nil { + return err + } + } + return nil +} + +func (b *Bot) sendHTML(ctx context.Context, chatID int64, htmlText string) error { + _, err := b.tg.SendMessage(ctx, chatID, htmlText, SendMessageOptions{ParseMode: "HTML"}) + return err +} + +func (b *Bot) sendError(ctx context.Context, chatID int64, prefix string, err error) error { + _, sendErr := b.tg.SendMessage(ctx, chatID, EscapeHTML(prefix+": "+err.Error()), SendMessageOptions{ParseMode: "HTML"}) + return sendErr +} + +func (b *Bot) sendWorkspaceMissing(ctx context.Context, chatID int64) error { + _, err := b.tg.SendMessage(ctx, chatID, "No workspace configured. Ask an admin to run scripts/add-workspace, then use /workspace.", SendMessageOptions{}) + return err +} + +func (b *Bot) sendNoActiveThread(ctx context.Context, chatID int64, err error) error { + if errors.Is(err, sql.ErrNoRows) { + _, sendErr := b.tg.SendMessage(ctx, chatID, "No active thread. Use /new.", SendMessageOptions{}) + return sendErr + } + return err +} + +func parseCommand(text string) (string, []string, bool) { + text = strings.TrimSpace(text) + if !strings.HasPrefix(text, "/") { + return "", nil, false + } + fields := strings.Fields(text) + if len(fields) == 0 { + return "", nil, false + } + name := strings.TrimPrefix(fields[0], "/") + if before, _, ok := strings.Cut(name, "@"); ok { + name = before + } + return strings.ToLower(name), fields[1:], true +} + +func resumeThreadListText(threads []store.Thread, page int) string { + lines := []string{fmt.Sprintf("Resume a thread (page %d):", page+1), ""} + for _, thread := range threads { + lines = append(lines, fmt.Sprintf("Thread ID %d: %s", thread.ID, threadDisplayTitle(thread))) + } + lines = append(lines, "", "Choose a button below, or use /resume THREAD_ID directly.") + return strings.Join(lines, "\n") +} + +func resumeThreadMarkup(threads []store.Thread, page int, hasNext bool) *InlineKeyboardMarkup { + keyboard := make([][]InlineKeyboardButton, 0, 4) + for _, thread := range threads { + button := InlineKeyboardButton{ + Text: fmt.Sprintf("ID %d", thread.ID), + CallbackData: ResumeThreadCallbackData(thread.ID), + } + if len(keyboard) == 0 || len(keyboard[len(keyboard)-1]) >= 4 { + keyboard = append(keyboard, []InlineKeyboardButton{button}) + continue + } + keyboard[len(keyboard)-1] = append(keyboard[len(keyboard)-1], button) + } + var nav []InlineKeyboardButton + if page > 0 { + nav = append(nav, InlineKeyboardButton{Text: "Prev", CallbackData: ResumePageCallbackData(page - 1)}) + } + if hasNext { + nav = append(nav, InlineKeyboardButton{Text: "Next", CallbackData: ResumePageCallbackData(page + 1)}) + } + if len(nav) > 0 { + keyboard = append(keyboard, nav) + } + return &InlineKeyboardMarkup{InlineKeyboard: keyboard} +} + +func threadDisplayTitle(thread store.Thread) string { + title := strings.Join(strings.Fields(thread.Title), " ") + if title == "" { + title = thread.CodexThreadID + } + runes := []rune(title) + if len(runes) > 90 { + title = string(runes[:90]) + "..." + } + return title +} + +func workspaceMarkup(workspaces []store.Workspace) *InlineKeyboardMarkup { + keyboard := make([][]InlineKeyboardButton, 0, len(workspaces)) + for _, ws := range workspaces { + text := ws.Label + if ws.IsDefault { + text += " default" + } + keyboard = append(keyboard, []InlineKeyboardButton{{ + Text: text, + CallbackData: WorkspaceCallbackData(ws.ID), + }}) + } + return &InlineKeyboardMarkup{InlineKeyboard: keyboard} +} + +func modelMarkup(models []codexapp.Model) *InlineKeyboardMarkup { + keyboard := make([][]InlineKeyboardButton, 0, len(models)) + for _, model := range models { + callbackData, ok := ModelCallbackData(model.ID) + if !ok { + continue + } + keyboard = append(keyboard, []InlineKeyboardButton{{ + Text: modelLabel(model), + CallbackData: callbackData, + }}) + } + return &InlineKeyboardMarkup{InlineKeyboard: keyboard} +} + +func effortMarkup(model codexapp.Model) *InlineKeyboardMarkup { + keyboard := make([][]InlineKeyboardButton, 0, len(model.SupportedReasoningEfforts)) + for _, option := range model.SupportedReasoningEfforts { + label := option.ReasoningEffort + if option.ReasoningEffort == model.DefaultReasoningEffort { + label += " default" + } + keyboard = append(keyboard, []InlineKeyboardButton{{ + Text: label, + CallbackData: EffortCallbackData(option.ReasoningEffort), + }}) + } + return &InlineKeyboardMarkup{InlineKeyboard: keyboard} +} + +func modelSupportsEffort(model codexapp.Model, effort string) bool { + for _, option := range model.SupportedReasoningEfforts { + if option.ReasoningEffort == effort { + return true + } + } + return false +} + +func modelLabel(model codexapp.Model) string { + label := model.DisplayName + if label == "" { + label = model.ID + } + if model.IsDefault { + label += " default" + } + return label +} + +func sessionModelLabel(models []codexapp.Model, modelID string) string { + if modelID == "" { + return "(Codex default)" + } + for _, model := range models { + if model.ID == modelID { + return modelLabel(model) + } + } + return modelID +} + +func settingsStatusText(model string, effort string) string { + if effort == "" { + effort = "(model default)" + } + return fmt.Sprintf("Current model: %s\nCurrent reasoning effort: %s", model, effort) +} + +func (b *Bot) rememberSettingsMessage(ctx context.Context, userID int64, chatID int64, messageID int) { + if messageID == 0 { + return + } + if err := b.store.SetSessionSettingsMessage(ctx, userID, chatID, messageID); err != nil { + b.logger.Printf("settings message store: %v", err) + return + } + if err := b.tg.PinChatMessage(ctx, chatID, messageID, true); err != nil { + b.logger.Printf("settings message pin: %v", err) + } +} + +func approvalMarkup(id int64) *InlineKeyboardMarkup { + return &InlineKeyboardMarkup{InlineKeyboard: [][]InlineKeyboardButton{ + { + {Text: "Approve", CallbackData: ApprovalCallbackData(id, "accept")}, + {Text: "Deny", CallbackData: ApprovalCallbackData(id, "decline")}, + }, + { + {Text: "Details", CallbackData: ApprovalCallbackData(id, "details")}, + {Text: "Cancel", CallbackData: ApprovalCallbackData(id, "cancel")}, + }, + }} +} + +func approvalResponse(approval store.PendingApproval, decision string) any { + if approval.Kind != "item/permissions/requestApproval" { + return map[string]any{"decision": decision} + } + + scope := "turn" + if decision == "acceptForSession" { + scope = "session" + } + permissions := map[string]any{} + if decision == "accept" || decision == "acceptForSession" { + var params struct { + Permissions map[string]any `json:"permissions"` + } + _ = json.Unmarshal([]byte(approval.PayloadJSON), ¶ms) + if params.Permissions != nil { + permissions = params.Permissions + } + } + return map[string]any{ + "permissions": permissions, + "scope": scope, + } +} + +func renderApprovalHTML(kind string, raw json.RawMessage, status string) string { + title := "Codex approval requested" + if strings.Contains(kind, "commandExecution") { + title = "Codex requests command approval" + } + if strings.Contains(kind, "fileChange") { + title = "Codex requests file change approval" + } + if strings.Contains(kind, "permissions") { + title = "Codex requests permission approval" + } + + var params map[string]any + _ = json.Unmarshal(raw, ¶ms) + lines := []string{title} + if reason, _ := params["reason"].(string); reason != "" { + lines = append(lines, "", reason) + } + for _, key := range []string{"command", "cwd", "grantRoot", "permissions"} { + if value, ok := params[key]; ok { + lines = append(lines, fmt.Sprintf("%s: %s", key, conciseValue(value))) + } + } + + summary := strings.Join(lines, "\n") + details := prettyJSON(raw) + limit := TelegramHTMLMessageLimit + if status != "" { + limit -= len([]rune(status)) + 1 + } + text := SummaryDetailsHTMLLimited(summary, details, limit) + if status != "" { + text += "\n" + EscapeHTML(status) + } + return text +} + +func approvalStatusLine(decision string) string { + switch decision { + case "accept": + return "Approved." + case "acceptForSession": + return "Approved for this session." + case "decline": + return "Disapproved." + case "cancel": + return "Canceled." + default: + return "Resolved: " + decision + "." + } +} + +func conciseValue(value any) string { + text := fmt.Sprint(value) + if data, err := json.Marshal(value); err == nil { + text = string(data) + } + text = strings.Join(strings.Fields(text), " ") + runes := []rune(text) + if len(runes) > 180 { + return string(runes[:180]) + "..." + } + return text +} + +func prettyJSON(raw json.RawMessage) string { + if len(raw) == 0 { + return "" + } + var value any + if err := json.Unmarshal(raw, &value); err != nil { + return string(raw) + } + data, err := json.MarshalIndent(value, "", " ") + if err != nil { + return string(raw) + } + return string(data) +} + +func largestPhoto(photos []PhotoSize) PhotoSize { + best := photos[0] + bestScore := best.Width * best.Height + for _, photo := range photos[1:] { + score := photo.Width * photo.Height + if score > bestScore { + best = photo + bestScore = score + } + } + return best +} + +func isImage(mimeType, filename string) bool { + if strings.HasPrefix(strings.ToLower(mimeType), "image/") { + return true + } + switch strings.ToLower(filepath.Ext(filename)) { + case ".jpg", ".jpeg", ".png", ".gif", ".webp": + return true + default: + return false + } +} + +func extensionForMime(mimeType string) string { + extensions, err := mime.ExtensionsByType(mimeType) + if err != nil || len(extensions) == 0 { + return "" + } + return extensions[0] +} + +func safeFilename(filename string) string { + base := filepath.Base(filename) + var builder strings.Builder + for _, r := range base { + switch { + case r >= 'a' && r <= 'z': + builder.WriteRune(r) + case r >= 'A' && r <= 'Z': + builder.WriteRune(r) + case r >= '0' && r <= '9': + builder.WriteRune(r) + case r == '.', r == '-', r == '_': + builder.WriteRune(r) + default: + builder.WriteByte('_') + } + } + if builder.Len() == 0 { + return "upload" + } + return builder.String() +} diff --git a/internal/telegram/download.go b/internal/telegram/download.go new file mode 100644 index 0000000..539c8b8 --- /dev/null +++ b/internal/telegram/download.go @@ -0,0 +1,26 @@ +package telegram + +import ( + "context" + "fmt" + "io" + "net/http" + "strings" +) + +func (c *Client) DownloadFilePath(ctx context.Context, filePath string) ([]byte, error) { + u := c.fileBaseURL + "/" + strings.TrimLeft(filePath, "/") + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u, nil) + if err != nil { + return nil, err + } + resp, err := c.httpClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, fmt.Errorf("download file: telegram returned %s", resp.Status) + } + return io.ReadAll(resp.Body) +} diff --git a/internal/telegram/render.go b/internal/telegram/render.go new file mode 100644 index 0000000..9600bbe --- /dev/null +++ b/internal/telegram/render.go @@ -0,0 +1,183 @@ +package telegram + +import ( + "encoding/base64" + "fmt" + "html" + "strconv" + "strings" +) + +const TelegramMessageLimit = 4096 +const TelegramHTMLMessageLimit = 3900 + +func EscapeHTML(text string) string { + return html.EscapeString(text) +} + +func SummaryDetailsHTML(summary, details string) string { + summary = strings.TrimSpace(summary) + details = strings.TrimSpace(details) + if details == "" { + return EscapeHTML(summary) + } + if summary == "" { + return ExpandableQuoteHTML(details) + } + return EscapeHTML(summary) + "\n" + ExpandableQuoteHTML(details) +} + +func ExpandableQuoteHTML(text string) string { + text = strings.TrimSpace(text) + if text == "" { + return "" + } + return "
" + EscapeHTML(text) + "
" +} + +func SummaryDetailsHTMLLimited(summary, details string, limit int) string { + if limit <= 0 { + limit = TelegramHTMLMessageLimit + } + summary = strings.TrimSpace(summary) + details = strings.TrimSpace(details) + out := SummaryDetailsHTML(summary, details) + if len([]rune(out)) <= limit || details == "" { + return out + } + + suffix := "\n...[truncated]" + runes := []rune(details) + for len(runes) > 0 { + candidateLen := len(runes) - max(1, (len([]rune(out))-limit)/2) + if candidateLen < 0 { + candidateLen = 0 + } + if candidateLen > len(runes) { + candidateLen = len(runes) + } + candidate := strings.TrimSpace(string(runes[:candidateLen])) + suffix + out = SummaryDetailsHTML(summary, candidate) + if len([]rune(out)) <= limit || candidateLen == 0 { + return out + } + runes = runes[:candidateLen] + } + return SummaryDetailsHTML(summary, suffix) +} + +func ChunkText(text string, max int) []string { + if max <= 0 { + max = TelegramMessageLimit + } + runes := []rune(text) + if len(runes) == 0 { + return nil + } + var chunks []string + for len(runes) > max { + cut := max + for i := max; i > max/2; i-- { + if runes[i-1] == '\n' { + cut = i + break + } + } + chunks = append(chunks, string(runes[:cut])) + runes = runes[cut:] + } + if len(runes) > 0 { + chunks = append(chunks, string(runes)) + } + return chunks +} + +func ApprovalCallbackData(id int64, decision string) string { + return fmt.Sprintf("approval:%d:%s", id, decision) +} + +func ParseApprovalCallbackData(data string) (int64, string, bool) { + parts := strings.Split(data, ":") + if len(parts) != 3 || parts[0] != "approval" { + return 0, "", false + } + id, err := strconv.ParseInt(parts[1], 10, 64) + if err != nil || id <= 0 { + return 0, "", false + } + switch parts[2] { + case "accept", "acceptForSession", "decline", "cancel", "details": + return id, parts[2], true + default: + return 0, "", false + } +} + +func WorkspaceCallbackData(id int64) string { + return fmt.Sprintf("workspace:%d", id) +} + +func ParseWorkspaceCallbackData(data string) (int64, bool) { + if !strings.HasPrefix(data, "workspace:") { + return 0, false + } + id, err := strconv.ParseInt(strings.TrimPrefix(data, "workspace:"), 10, 64) + return id, err == nil && id > 0 +} + +func ResumeThreadCallbackData(id int64) string { + return fmt.Sprintf("resume:thread:%d", id) +} + +func ParseResumeThreadCallbackData(data string) (int64, bool) { + if !strings.HasPrefix(data, "resume:thread:") { + return 0, false + } + id, err := strconv.ParseInt(strings.TrimPrefix(data, "resume:thread:"), 10, 64) + return id, err == nil && id > 0 +} + +func ResumePageCallbackData(page int) string { + return fmt.Sprintf("resume:page:%d", page) +} + +func ParseResumePageCallbackData(data string) (int, bool) { + if !strings.HasPrefix(data, "resume:page:") { + return 0, false + } + page, err := strconv.Atoi(strings.TrimPrefix(data, "resume:page:")) + return page, err == nil && page >= 0 +} + +func ModelCallbackData(modelID string) (string, bool) { + encoded := base64.RawURLEncoding.EncodeToString([]byte(modelID)) + data := "model:" + encoded + return data, len([]rune(data)) <= 64 +} + +func ParseModelCallbackData(data string) (string, bool) { + if !strings.HasPrefix(data, "model:") { + return "", false + } + decoded, err := base64.RawURLEncoding.DecodeString(strings.TrimPrefix(data, "model:")) + if err != nil || len(decoded) == 0 { + return "", false + } + return string(decoded), true +} + +func EffortCallbackData(effort string) string { + encoded := base64.RawURLEncoding.EncodeToString([]byte(effort)) + return "effort:" + encoded +} + +func ParseEffortCallbackData(data string) (string, bool) { + if !strings.HasPrefix(data, "effort:") { + return "", false + } + decoded, err := base64.RawURLEncoding.DecodeString(strings.TrimPrefix(data, "effort:")) + if err != nil || len(decoded) == 0 { + return "", false + } + return string(decoded), true +} diff --git a/internal/telegram/render_test.go b/internal/telegram/render_test.go new file mode 100644 index 0000000..5e321c8 --- /dev/null +++ b/internal/telegram/render_test.go @@ -0,0 +1,152 @@ +package telegram + +import ( + "strings" + "testing" + + "codex-telegram-bot/internal/store" +) + +func TestEscapeHTML(t *testing.T) { + got := EscapeHTML(``) + want := "<run & "test">" + if got != want { + t.Fatalf("EscapeHTML() = %q, want %q", got, want) + } +} + +func TestChunkText(t *testing.T) { + text := strings.Repeat("a", 25) + chunks := ChunkText(text, 10) + if len(chunks) != 3 { + t.Fatalf("got %d chunks", len(chunks)) + } + for _, chunk := range chunks { + if len([]rune(chunk)) > 10 { + t.Fatalf("chunk too long: %q", chunk) + } + } +} + +func TestApprovalCallbackData(t *testing.T) { + data := ApprovalCallbackData(12, "accept") + id, decision, ok := ParseApprovalCallbackData(data) + if !ok || id != 12 || decision != "accept" { + t.Fatalf("unexpected callback parse: id=%d decision=%s ok=%v", id, decision, ok) + } + if _, _, ok := ParseApprovalCallbackData("approval:12:unknown"); ok { + t.Fatal("unknown decisions should be rejected") + } +} + +func TestApprovalResponseForPermissions(t *testing.T) { + approval := store.PendingApproval{ + Kind: "item/permissions/requestApproval", + PayloadJSON: `{"permissions":{"network":{"enabled":true}}}`, + } + response, ok := approvalResponse(approval, "accept").(map[string]any) + if !ok { + t.Fatal("approval response should be a map") + } + if response["scope"] != "turn" { + t.Fatalf("scope = %v, want turn", response["scope"]) + } + permissions, ok := response["permissions"].(map[string]any) + if !ok { + t.Fatal("permissions should be a map") + } + network, ok := permissions["network"].(map[string]any) + if !ok || network["enabled"] != true { + t.Fatalf("unexpected permissions: %#v", permissions) + } + + denied, ok := approvalResponse(approval, "decline").(map[string]any) + if !ok { + t.Fatal("denied response should be a map") + } + deniedPermissions, ok := denied["permissions"].(map[string]any) + if !ok || len(deniedPermissions) != 0 { + t.Fatalf("denied permissions = %#v, want empty map", denied["permissions"]) + } +} + +func TestParseCommand(t *testing.T) { + name, args, ok := parseCommand("/resume@my_bot 123") + if !ok || name != "resume" || len(args) != 1 || args[0] != "123" { + t.Fatalf("unexpected command parse: %q %#v %v", name, args, ok) + } +} + +func TestRenderCodexCommandExecutionItem(t *testing.T) { + output := "line 1\nline 2" + exitCode := 0 + item := codexThreadItemView{ + Type: "commandExecution", + Command: "go test ./...", + AggregatedOutput: &output, + ExitCode: &exitCode, + } + text := renderCodexItemCompleted(item) + for _, want := range []string{"Tool call: command finished", "Command: go test ./...", "Exit code: 0", "line 1"} { + if !strings.Contains(text, want) { + t.Fatalf("rendered command item missing %q in %q", want, text) + } + } +} + +func TestRenderCodexStartedItems(t *testing.T) { + text := renderCodexItemStarted(codexThreadItemView{Type: "webSearch", Query: "telegram bot api"}) + if !strings.Contains(text, "web search started") || !strings.Contains(text, "telegram bot api") { + t.Fatalf("unexpected web search render: %q", text) + } +} + +func TestResumeCallbackData(t *testing.T) { + threadID, ok := ParseResumeThreadCallbackData(ResumeThreadCallbackData(123)) + if !ok || threadID != 123 { + t.Fatalf("unexpected resume thread callback: id=%d ok=%v", threadID, ok) + } + page, ok := ParseResumePageCallbackData(ResumePageCallbackData(2)) + if !ok || page != 2 { + t.Fatalf("unexpected resume page callback: page=%d ok=%v", page, ok) + } +} + +func TestResumeThreadListText(t *testing.T) { + threads := []store.Thread{{ID: 42, Title: "do xyz"}, {ID: 43, Title: "executed xxx command"}} + text := resumeThreadListText(threads, 0) + for _, want := range []string{"Thread ID 42: do xyz", "Thread ID 43: executed xxx command"} { + if !strings.Contains(text, want) { + t.Fatalf("resume list missing %q in %q", want, text) + } + } + markup := resumeThreadMarkup(threads, 0, true) + if len(markup.InlineKeyboard) != 2 || markup.InlineKeyboard[0][0].Text != "ID 42" || markup.InlineKeyboard[0][1].Text != "ID 43" { + t.Fatalf("unexpected resume buttons: %#v", markup.InlineKeyboard) + } + firstID, ok := ParseResumeThreadCallbackData(markup.InlineKeyboard[0][0].CallbackData) + if !ok || firstID != 42 { + t.Fatalf("first resume button targets id=%d ok=%v", firstID, ok) + } + secondID, ok := ParseResumeThreadCallbackData(markup.InlineKeyboard[0][1].CallbackData) + if !ok || secondID != 43 { + t.Fatalf("second resume button targets id=%d ok=%v", secondID, ok) + } +} + +func TestModelAndEffortCallbackData(t *testing.T) { + modelID := strings.Join([]string{"server", "model", "id"}, "-") + data, ok := ModelCallbackData(modelID) + if !ok { + t.Fatal("model callback should fit") + } + model, ok := ParseModelCallbackData(data) + if !ok || model != modelID { + t.Fatalf("unexpected model callback parse: model=%q ok=%v", model, ok) + } + effortName := strings.Join([]string{"server", "effort"}, "-") + effort, ok := ParseEffortCallbackData(EffortCallbackData(effortName)) + if !ok || effort != effortName { + t.Fatalf("unexpected effort callback parse: effort=%q ok=%v", effort, ok) + } +} diff --git a/internal/telegram/types.go b/internal/telegram/types.go new file mode 100644 index 0000000..1943692 --- /dev/null +++ b/internal/telegram/types.go @@ -0,0 +1,76 @@ +package telegram + +type Update struct { + UpdateID int `json:"update_id"` + Message *Message `json:"message,omitempty"` + CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` +} + +type User struct { + ID int64 `json:"id"` + IsBot bool `json:"is_bot"` + FirstName string `json:"first_name,omitempty"` + Username string `json:"username,omitempty"` +} + +type Chat struct { + ID int64 `json:"id"` + Type string `json:"type"` +} + +type Message struct { + MessageID int `json:"message_id"` + From *User `json:"from,omitempty"` + Chat Chat `json:"chat"` + Text string `json:"text,omitempty"` + Caption string `json:"caption,omitempty"` + Document *Document `json:"document,omitempty"` + Photo []PhotoSize `json:"photo,omitempty"` + PinnedMessage *Message `json:"pinned_message,omitempty"` +} + +type Document struct { + FileID string `json:"file_id"` + FileName string `json:"file_name,omitempty"` + MimeType string `json:"mime_type,omitempty"` + FileSize int64 `json:"file_size,omitempty"` +} + +type PhotoSize struct { + FileID string `json:"file_id"` + FileSize int64 `json:"file_size,omitempty"` + Width int `json:"width"` + Height int `json:"height"` +} + +type CallbackQuery struct { + ID string `json:"id"` + From User `json:"from"` + Message *Message `json:"message,omitempty"` + Data string `json:"data,omitempty"` +} + +type File struct { + FileID string `json:"file_id"` + FilePath string `json:"file_path,omitempty"` + FileSize int64 `json:"file_size,omitempty"` +} + +type InlineKeyboardMarkup struct { + InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"` +} + +type InlineKeyboardButton struct { + Text string `json:"text"` + CallbackData string `json:"callback_data,omitempty"` +} + +type SendMessageOptions struct { + ParseMode string `json:"parse_mode,omitempty"` + ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` +} + +type EditMessageTextOptions struct { + ParseMode string `json:"parse_mode,omitempty"` + ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` +} diff --git a/schemas/ApplyPatchApprovalParams.json b/schemas/ApplyPatchApprovalParams.json new file mode 100644 index 0000000..1be3fa0 --- /dev/null +++ b/schemas/ApplyPatchApprovalParams.json @@ -0,0 +1,114 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApplyPatchApprovalParams", + "type": "object", + "required": [ + "callId", + "conversationId", + "fileChanges" + ], + "properties": { + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] and [codex_protocol::protocol::PatchApplyEndEvent].", + "type": "string" + }, + "conversationId": { + "$ref": "#/definitions/ThreadId" + }, + "fileChanges": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "grantRoot": { + "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "FileChange": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddFileChangeType" + } + }, + "title": "AddFileChange" + }, + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeleteFileChangeType" + } + }, + "title": "DeleteFileChange" + }, + { + "type": "object", + "required": [ + "type", + "unified_diff" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdateFileChangeType" + }, + "unified_diff": { + "type": "string" + } + }, + "title": "UpdateFileChange" + } + ] + }, + "ThreadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/ApplyPatchApprovalResponse.json b/schemas/ApplyPatchApprovalResponse.json new file mode 100644 index 0000000..d672a06 --- /dev/null +++ b/schemas/ApplyPatchApprovalResponse.json @@ -0,0 +1,124 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApplyPatchApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/ReviewDecision" + } + }, + "definitions": { + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "ReviewDecision": { + "description": "User's decision in response to an ExecApprovalRequest.", + "oneOf": [ + { + "description": "User has approved this command and the agent should execute it.", + "type": "string", + "enum": [ + "approved" + ] + }, + { + "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + "type": "object", + "required": [ + "approved_execpolicy_amendment" + ], + "properties": { + "approved_execpolicy_amendment": { + "type": "object", + "required": [ + "proposed_execpolicy_amendment" + ], + "properties": { + "proposed_execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "ApprovedExecpolicyAmendmentReviewDecision" + }, + { + "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + "type": "string", + "enum": [ + "approved_for_session" + ] + }, + { + "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "NetworkPolicyAmendmentReviewDecision" + }, + { + "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "type": "string", + "enum": [ + "denied" + ] + }, + { + "description": "Automatic approval review timed out before reaching a decision.", + "type": "string", + "enum": [ + "timed_out" + ] + }, + { + "description": "User has denied this command and the agent should not do anything until the user's next command.", + "type": "string", + "enum": [ + "abort" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/AttestationGenerateParams.json b/schemas/AttestationGenerateParams.json new file mode 100644 index 0000000..310552b --- /dev/null +++ b/schemas/AttestationGenerateParams.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AttestationGenerateParams", + "type": "object" +} \ No newline at end of file diff --git a/schemas/AttestationGenerateResponse.json b/schemas/AttestationGenerateResponse.json new file mode 100644 index 0000000..cb8a3df --- /dev/null +++ b/schemas/AttestationGenerateResponse.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AttestationGenerateResponse", + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "description": "Opaque client attestation token.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/ChatgptAuthTokensRefreshParams.json b/schemas/ChatgptAuthTokensRefreshParams.json new file mode 100644 index 0000000..81616f4 --- /dev/null +++ b/schemas/ChatgptAuthTokensRefreshParams.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChatgptAuthTokensRefreshParams", + "type": "object", + "required": [ + "reason" + ], + "properties": { + "previousAccountId": { + "description": "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior auth state did not include a workspace identifier (`chatgpt_account_id`).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "$ref": "#/definitions/ChatgptAuthTokensRefreshReason" + } + }, + "definitions": { + "ChatgptAuthTokensRefreshReason": { + "oneOf": [ + { + "description": "Codex attempted a backend request and received `401 Unauthorized`.", + "type": "string", + "enum": [ + "unauthorized" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/ChatgptAuthTokensRefreshResponse.json b/schemas/ChatgptAuthTokensRefreshResponse.json new file mode 100644 index 0000000..30956ff --- /dev/null +++ b/schemas/ChatgptAuthTokensRefreshResponse.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChatgptAuthTokensRefreshResponse", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId" + ], + "properties": { + "accessToken": { + "type": "string" + }, + "chatgptAccountId": { + "type": "string" + }, + "chatgptPlanType": { + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/ClientNotification.json b/schemas/ClientNotification.json new file mode 100644 index 0000000..a9be274 --- /dev/null +++ b/schemas/ClientNotification.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClientNotification", + "oneOf": [ + { + "type": "object", + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "initialized" + ], + "title": "InitializedNotificationMethod" + } + }, + "title": "InitializedNotification" + } + ] +} \ No newline at end of file diff --git a/schemas/ClientRequest.json b/schemas/ClientRequest.json new file mode 100644 index 0000000..41b06e9 --- /dev/null +++ b/schemas/ClientRequest.json @@ -0,0 +1,5972 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClientRequest", + "description": "Request from the client to the server.", + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "initialize" + ], + "title": "InitializeRequestMethod" + }, + "params": { + "$ref": "#/definitions/InitializeParams" + } + }, + "title": "InitializeRequest" + }, + { + "description": "NEW APIs", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/start" + ], + "title": "Thread/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStartParams" + } + }, + "title": "Thread/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/resume" + ], + "title": "Thread/resumeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadResumeParams" + } + }, + "title": "Thread/resumeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/fork" + ], + "title": "Thread/forkRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadForkParams" + } + }, + "title": "Thread/forkRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/archive" + ], + "title": "Thread/archiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadArchiveParams" + } + }, + "title": "Thread/archiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unsubscribe" + ], + "title": "Thread/unsubscribeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnsubscribeParams" + } + }, + "title": "Thread/unsubscribeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/name/set" + ], + "title": "Thread/name/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadSetNameParams" + } + }, + "title": "Thread/name/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/metadata/update" + ], + "title": "Thread/metadata/updateRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadMetadataUpdateParams" + } + }, + "title": "Thread/metadata/updateRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unarchive" + ], + "title": "Thread/unarchiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnarchiveParams" + } + }, + "title": "Thread/unarchiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/compact/start" + ], + "title": "Thread/compact/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadCompactStartParams" + } + }, + "title": "Thread/compact/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/shellCommand" + ], + "title": "Thread/shellCommandRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadShellCommandParams" + } + }, + "title": "Thread/shellCommandRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/approveGuardianDeniedAction" + ], + "title": "Thread/approveGuardianDeniedActionRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadApproveGuardianDeniedActionParams" + } + }, + "title": "Thread/approveGuardianDeniedActionRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/rollback" + ], + "title": "Thread/rollbackRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRollbackParams" + } + }, + "title": "Thread/rollbackRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/list" + ], + "title": "Thread/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadListParams" + } + }, + "title": "Thread/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/loaded/list" + ], + "title": "Thread/loaded/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadLoadedListParams" + } + }, + "title": "Thread/loaded/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/read" + ], + "title": "Thread/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadReadParams" + } + }, + "title": "Thread/readRequest" + }, + { + "description": "Append raw Responses API items to the thread history without starting a user turn.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/inject_items" + ], + "title": "Thread/injectItemsRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadInjectItemsParams" + } + }, + "title": "Thread/injectItemsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/list" + ], + "title": "Skills/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/SkillsListParams" + } + }, + "title": "Skills/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "hooks/list" + ], + "title": "Hooks/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/HooksListParams" + } + }, + "title": "Hooks/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/add" + ], + "title": "Marketplace/addRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceAddParams" + } + }, + "title": "Marketplace/addRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/remove" + ], + "title": "Marketplace/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceRemoveParams" + } + }, + "title": "Marketplace/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/upgrade" + ], + "title": "Marketplace/upgradeRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceUpgradeParams" + } + }, + "title": "Marketplace/upgradeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/list" + ], + "title": "Plugin/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginListParams" + } + }, + "title": "Plugin/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/installed" + ], + "title": "Plugin/installedRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginInstalledParams" + } + }, + "title": "Plugin/installedRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/read" + ], + "title": "Plugin/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginReadParams" + } + }, + "title": "Plugin/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/skill/read" + ], + "title": "Plugin/skill/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginSkillReadParams" + } + }, + "title": "Plugin/skill/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/save" + ], + "title": "Plugin/share/saveRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareSaveParams" + } + }, + "title": "Plugin/share/saveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/updateTargets" + ], + "title": "Plugin/share/updateTargetsRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareUpdateTargetsParams" + } + }, + "title": "Plugin/share/updateTargetsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/list" + ], + "title": "Plugin/share/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareListParams" + } + }, + "title": "Plugin/share/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/checkout" + ], + "title": "Plugin/share/checkoutRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareCheckoutParams" + } + }, + "title": "Plugin/share/checkoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/delete" + ], + "title": "Plugin/share/deleteRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareDeleteParams" + } + }, + "title": "Plugin/share/deleteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "app/list" + ], + "title": "App/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/AppsListParams" + } + }, + "title": "App/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readFile" + ], + "title": "Fs/readFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsReadFileParams" + } + }, + "title": "Fs/readFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/writeFile" + ], + "title": "Fs/writeFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsWriteFileParams" + } + }, + "title": "Fs/writeFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/createDirectory" + ], + "title": "Fs/createDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsCreateDirectoryParams" + } + }, + "title": "Fs/createDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/getMetadata" + ], + "title": "Fs/getMetadataRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsGetMetadataParams" + } + }, + "title": "Fs/getMetadataRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readDirectory" + ], + "title": "Fs/readDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsReadDirectoryParams" + } + }, + "title": "Fs/readDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/remove" + ], + "title": "Fs/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsRemoveParams" + } + }, + "title": "Fs/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/copy" + ], + "title": "Fs/copyRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsCopyParams" + } + }, + "title": "Fs/copyRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/watch" + ], + "title": "Fs/watchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsWatchParams" + } + }, + "title": "Fs/watchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/unwatch" + ], + "title": "Fs/unwatchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsUnwatchParams" + } + }, + "title": "Fs/unwatchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/config/write" + ], + "title": "Skills/config/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/SkillsConfigWriteParams" + } + }, + "title": "Skills/config/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/install" + ], + "title": "Plugin/installRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginInstallParams" + } + }, + "title": "Plugin/installRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/uninstall" + ], + "title": "Plugin/uninstallRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginUninstallParams" + } + }, + "title": "Plugin/uninstallRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/start" + ], + "title": "Turn/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnStartParams" + } + }, + "title": "Turn/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/steer" + ], + "title": "Turn/steerRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnSteerParams" + } + }, + "title": "Turn/steerRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/interrupt" + ], + "title": "Turn/interruptRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnInterruptParams" + } + }, + "title": "Turn/interruptRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "review/start" + ], + "title": "Review/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ReviewStartParams" + } + }, + "title": "Review/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "model/list" + ], + "title": "Model/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ModelListParams" + } + }, + "title": "Model/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "modelProvider/capabilities/read" + ], + "title": "ModelProvider/capabilities/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ModelProviderCapabilitiesReadParams" + } + }, + "title": "ModelProvider/capabilities/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/list" + ], + "title": "ExperimentalFeature/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExperimentalFeatureListParams" + } + }, + "title": "ExperimentalFeature/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/enablement/set" + ], + "title": "ExperimentalFeature/enablement/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExperimentalFeatureEnablementSetParams" + } + }, + "title": "ExperimentalFeature/enablement/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/oauth/login" + ], + "title": "McpServer/oauth/loginRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerOauthLoginParams" + } + }, + "title": "McpServer/oauth/loginRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/mcpServer/reload" + ], + "title": "Config/mcpServer/reloadRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Config/mcpServer/reloadRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServerStatus/list" + ], + "title": "McpServerStatus/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ListMcpServerStatusParams" + } + }, + "title": "McpServerStatus/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/resource/read" + ], + "title": "McpServer/resource/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpResourceReadParams" + } + }, + "title": "McpServer/resource/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerToolCallParams" + } + }, + "title": "McpServer/tool/callRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupStart" + ], + "title": "WindowsSandbox/setupStartRequestMethod" + }, + "params": { + "$ref": "#/definitions/WindowsSandboxSetupStartParams" + } + }, + "title": "WindowsSandbox/setupStartRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/readiness" + ], + "title": "WindowsSandbox/readinessRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "WindowsSandbox/readinessRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/start" + ], + "title": "Account/login/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/LoginAccountParams" + } + }, + "title": "Account/login/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/cancel" + ], + "title": "Account/login/cancelRequestMethod" + }, + "params": { + "$ref": "#/definitions/CancelLoginAccountParams" + } + }, + "title": "Account/login/cancelRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/logout" + ], + "title": "Account/logoutRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/logoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/rateLimits/read" + ], + "title": "Account/rateLimits/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/rateLimits/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/sendAddCreditsNudgeEmail" + ], + "title": "Account/sendAddCreditsNudgeEmailRequestMethod" + }, + "params": { + "$ref": "#/definitions/SendAddCreditsNudgeEmailParams" + } + }, + "title": "Account/sendAddCreditsNudgeEmailRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "feedback/upload" + ], + "title": "Feedback/uploadRequestMethod" + }, + "params": { + "$ref": "#/definitions/FeedbackUploadParams" + } + }, + "title": "Feedback/uploadRequest" + }, + { + "description": "Execute a standalone command (argv vector) under the server's sandbox.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec" + ], + "title": "Command/execRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecParams" + } + }, + "title": "Command/execRequest" + }, + { + "description": "Write stdin bytes to a running `command/exec` session or close stdin.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/write" + ], + "title": "Command/exec/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecWriteParams" + } + }, + "title": "Command/exec/writeRequest" + }, + { + "description": "Terminate a running `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/terminate" + ], + "title": "Command/exec/terminateRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecTerminateParams" + } + }, + "title": "Command/exec/terminateRequest" + }, + { + "description": "Resize a running PTY-backed `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/resize" + ], + "title": "Command/exec/resizeRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecResizeParams" + } + }, + "title": "Command/exec/resizeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/read" + ], + "title": "Config/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigReadParams" + } + }, + "title": "Config/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/detect" + ], + "title": "ExternalAgentConfig/detectRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigDetectParams" + } + }, + "title": "ExternalAgentConfig/detectRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import" + ], + "title": "ExternalAgentConfig/importRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigImportParams" + } + }, + "title": "ExternalAgentConfig/importRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/value/write" + ], + "title": "Config/value/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigValueWriteParams" + } + }, + "title": "Config/value/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/batchWrite" + ], + "title": "Config/batchWriteRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigBatchWriteParams" + } + }, + "title": "Config/batchWriteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "configRequirements/read" + ], + "title": "ConfigRequirements/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "ConfigRequirements/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/read" + ], + "title": "Account/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/GetAccountParams" + } + }, + "title": "Account/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch" + ], + "title": "FuzzyFileSearchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchParams" + } + }, + "title": "FuzzyFileSearchRequest" + } + ], + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "AddCreditsNudgeCreditType": { + "type": "string", + "enum": [ + "credits", + "usage_limit" + ] + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AppsListParams": { + "description": "EXPERIMENTAL - list available apps/connectors.", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "forceRefetch": { + "description": "When true, bypass app caches and fetch the latest data from sources.", + "type": "boolean" + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional thread id used to evaluate app feature gating from that thread's config.", + "type": [ + "string", + "null" + ] + } + } + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CancelLoginAccountParams": { + "type": "object", + "required": [ + "loginId" + ], + "properties": { + "loginId": { + "type": "string" + } + } + }, + "ClientInfo": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string" + } + } + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "type": "object", + "required": [ + "mode", + "settings" + ], + "properties": { + "mode": { + "$ref": "#/definitions/ModeKind" + }, + "settings": { + "$ref": "#/definitions/Settings" + } + } + }, + "WindowsSandboxSetupStartParams": { + "type": "object", + "required": [ + "mode" + ], + "properties": { + "cwd": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + } + } + }, + "CommandExecParams": { + "description": "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", + "type": "object", + "required": [ + "command" + ], + "properties": { + "command": { + "description": "Command argv vector. Empty arrays are rejected.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "Optional working directory. Defaults to the server cwd.", + "type": [ + "string", + "null" + ] + }, + "disableOutputCap": { + "description": "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + "type": "boolean" + }, + "disableTimeout": { + "description": "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + "type": "boolean" + }, + "env": { + "description": "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": [ + "string", + "null" + ] + } + }, + "outputBytesCap": { + "description": "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "tty": { + "description": "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + "type": "boolean" + }, + "processId": { + "description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + "type": [ + "string", + "null" + ] + }, + "sandboxPolicy": { + "description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + }, + "size": { + "description": "Optional initial PTY size in character cells. Only valid when `tty` is true.", + "anyOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + }, + { + "type": "null" + } + ] + }, + "streamStdin": { + "description": "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + "type": "boolean" + }, + "streamStdoutStderr": { + "description": "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + "type": "boolean" + }, + "timeoutMs": { + "description": "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "CommandExecResizeParams": { + "description": "Resize a running PTY-backed `command/exec` session.", + "type": "object", + "required": [ + "processId", + "size" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "size": { + "description": "New PTY size in character cells.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + } + ] + } + } + }, + "CommandExecTerminalSize": { + "description": "PTY size in character cells for `command/exec` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "CommandExecTerminateParams": { + "description": "Terminate a running `command/exec` session.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandExecWriteParams": { + "description": "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "closeStdin": { + "description": "Close stdin after writing `deltaBase64`, if present.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Optional base64-encoded stdin bytes to write.", + "type": [ + "string", + "null" + ] + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ConfigBatchWriteParams": { + "type": "object", + "required": [ + "edits" + ], + "properties": { + "edits": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigEdit" + } + }, + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "reloadUserConfig": { + "description": "When true, hot-reload the updated user config into all loaded threads after writing.", + "type": "boolean" + } + } + }, + "ConfigEdit": { + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + } + }, + "ConfigReadParams": { + "type": "object", + "properties": { + "cwd": { + "description": "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", + "type": [ + "string", + "null" + ] + }, + "includeLayers": { + "default": false, + "type": "boolean" + } + } + }, + "ConfigValueWriteParams": { + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + } + }, + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType" + } + }, + "title": "InputTextContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType" + } + }, + "title": "InputImageContentItem" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType" + } + }, + "title": "OutputTextContentItem" + } + ] + }, + "DynamicToolSpec": { + "type": "object", + "required": [ + "description", + "inputSchema", + "name" + ], + "properties": { + "deferLoading": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + } + } + }, + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + }, + "ExperimentalFeatureEnablementSetParams": { + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "ExperimentalFeatureListParams": { + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", + "type": [ + "string", + "null" + ] + } + } + }, + "ExternalAgentConfigDetectParams": { + "type": "object", + "properties": { + "cwds": { + "description": "Zero or more working directories to include for repo-scoped detection.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeHome": { + "description": "If true, include detection under the user's home (~/.claude, ~/.codex, etc.).", + "type": "boolean" + } + } + }, + "ExternalAgentConfigImportParams": { + "type": "object", + "required": [ + "migrationItems" + ], + "properties": { + "migrationItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItem" + } + } + } + }, + "ExternalAgentConfigMigrationItem": { + "type": "object", + "required": [ + "description", + "itemType" + ], + "properties": { + "cwd": { + "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "$ref": "#/definitions/MigrationDetails" + }, + { + "type": "null" + } + ] + }, + "itemType": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItemType" + } + } + }, + "ExternalAgentConfigMigrationItemType": { + "type": "string", + "enum": [ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "SESSIONS" + ] + }, + "FeedbackUploadParams": { + "type": "object", + "required": [ + "classification", + "includeLogs" + ], + "properties": { + "classification": { + "type": "string" + }, + "extraLogFiles": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeLogs": { + "type": "boolean" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "tags": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "threadId": { + "type": [ + "string", + "null" + ] + } + } + }, + "FsCopyParams": { + "description": "Copy a file or directory tree on the host filesystem.", + "type": "object", + "required": [ + "destinationPath", + "sourcePath" + ], + "properties": { + "destinationPath": { + "description": "Absolute destination path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Required for directory copies; ignored for file copies.", + "type": "boolean" + }, + "sourcePath": { + "description": "Absolute source path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsCreateDirectoryParams": { + "description": "Create a directory on the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to create.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether parent directories should also be created. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsGetMetadataParams": { + "description": "Request metadata for an absolute path.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to inspect.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsReadDirectoryParams": { + "description": "List direct child names for a directory.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsReadFileParams": { + "description": "Read a file from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsRemoveParams": { + "description": "Remove a file or directory tree from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "force": { + "description": "Whether missing paths should be ignored. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + }, + "path": { + "description": "Absolute path to remove.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether directory removal should recurse. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsUnwatchParams": { + "description": "Stop filesystem watch notifications for a prior `fs/watch`.", + "type": "object", + "required": [ + "watchId" + ], + "properties": { + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "FsWatchParams": { + "description": "Start filesystem watch notifications for an absolute path.", + "type": "object", + "required": [ + "path", + "watchId" + ], + "properties": { + "path": { + "description": "Absolute file or directory path to watch.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "watchId": { + "description": "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", + "type": "string" + } + } + }, + "FsWriteFileParams": { + "description": "Write a file on the host filesystem.", + "type": "object", + "required": [ + "dataBase64", + "path" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + }, + "path": { + "description": "Absolute path to write.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType" + } + }, + "title": "InputTextFunctionCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType" + } + }, + "title": "InputImageFunctionCallOutputContentItem" + } + ] + }, + "FuzzyFileSearchParams": { + "type": "object", + "required": [ + "query", + "roots" + ], + "properties": { + "cancellationToken": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": "string" + }, + "roots": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "TurnSteerParams": { + "type": "object", + "required": [ + "expectedTurnId", + "input", + "threadId" + ], + "properties": { + "expectedTurnId": { + "description": "Required active turn id precondition. The request fails when it does not match the currently active turn.", + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "threadId": { + "type": "string" + } + } + }, + "TurnStartParams": { + "type": "object", + "required": [ + "input", + "threadId" + ], + "properties": { + "approvalPolicy": { + "description": "Override the approval policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "description": "Override the service tier for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Override the working directory for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "effort": { + "description": "Override the reasoning effort for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "model": { + "description": "Override the model for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "outputSchema": { + "description": "Optional JSON Schema used to constrain the final assistant message for this turn." + }, + "summary": { + "description": "Override the reasoning summary for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "personality": { + "description": "Override the personality for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "sandboxPolicy": { + "description": "Override the sandbox policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + } + } + }, + "GetAccountParams": { + "type": "object", + "properties": { + "refreshToken": { + "description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + "default": false, + "type": "boolean" + } + } + }, + "HookMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "HooksListParams": { + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "InitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", + "type": "object", + "properties": { + "experimentalApi": { + "description": "Opt into receiving experimental API methods and fields.", + "default": false, + "type": "boolean" + }, + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requestAttestation": { + "description": "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + "default": false, + "type": "boolean" + } + } + }, + "InitializeParams": { + "type": "object", + "required": [ + "clientInfo" + ], + "properties": { + "capabilities": { + "anyOf": [ + { + "$ref": "#/definitions/InitializeCapabilities" + }, + { + "type": "null" + } + ] + }, + "clientInfo": { + "$ref": "#/definitions/ClientInfo" + } + } + }, + "ListMcpServerStatusParams": { + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "detail": { + "description": "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", + "anyOf": [ + { + "$ref": "#/definitions/McpServerStatusDetail" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a server-defined value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "title": "ExecLocalShellAction" + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "LoginAccountParams": { + "oneOf": [ + { + "type": "object", + "required": [ + "apiKey", + "type" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyLoginAccountParamsType" + } + }, + "title": "ApiKeyLoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "codexStreamlinedLogin": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "ChatgptLoginAccountParamsType" + } + }, + "title": "ChatgptLoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodeLoginAccountParamsType" + } + }, + "title": "ChatgptDeviceCodeLoginAccountParams" + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId", + "type" + ], + "properties": { + "accessToken": { + "description": "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", + "type": "string" + }, + "chatgptAccountId": { + "description": "Workspace/account identifier supplied by the client.", + "type": "string" + }, + "chatgptPlanType": { + "description": "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensLoginAccountParamsType" + } + }, + "title": "ChatgptAuthTokensLoginAccountParams" + } + ] + }, + "MarketplaceAddParams": { + "type": "object", + "required": [ + "source" + ], + "properties": { + "refName": { + "type": [ + "string", + "null" + ] + }, + "source": { + "type": "string" + }, + "sparsePaths": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "MarketplaceRemoveParams": { + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceUpgradeParams": { + "type": "object", + "properties": { + "marketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "McpResourceReadParams": { + "type": "object", + "required": [ + "server", + "uri" + ], + "properties": { + "server": { + "type": "string" + }, + "threadId": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "McpServerMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "McpServerOauthLoginParams": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "timeoutSecs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "McpServerStatusDetail": { + "type": "string", + "enum": [ + "full", + "toolsAndAuthOnly" + ] + }, + "McpServerToolCallParams": { + "type": "object", + "required": [ + "server", + "threadId", + "tool" + ], + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + } + }, + "MergeStrategy": { + "type": "string", + "enum": [ + "replace", + "upsert" + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "MigrationDetails": { + "type": "object", + "properties": { + "commands": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/CommandMigration" + } + }, + "hooks": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/HookMigration" + } + }, + "mcpServers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/McpServerMigration" + } + }, + "plugins": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PluginsMigration" + } + }, + "sessions": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SessionMigration" + } + }, + "subagents": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SubagentMigration" + } + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "type": "string", + "enum": [ + "plan", + "default" + ] + }, + "ModelListParams": { + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "includeHidden": { + "description": "When true, include models that are hidden from the default picker list.", + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ModelProviderCapabilitiesReadParams": { + "type": "object" + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "PluginInstallParams": { + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginInstalledParams": { + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "installSuggestionPluginNames": { + "description": "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginListMarketplaceKind": { + "type": "string", + "enum": [ + "local", + "workspace-directory", + "shared-with-me" + ] + }, + "PluginListParams": { + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "marketplaceKinds": { + "description": "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginListMarketplaceKind" + } + } + } + }, + "PluginReadParams": { + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareCheckoutParams": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "PluginShareDeleteParams": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginShareListParams": { + "type": "object" + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginShareSaveParams": { + "type": "object", + "required": [ + "pluginPath" + ], + "properties": { + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "pluginPath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "remotePluginId": { + "type": [ + "string", + "null" + ] + }, + "shareTargets": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + } + }, + "PluginShareTarget": { + "type": "object", + "required": [ + "principalId", + "principalType", + "role" + ], + "properties": { + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginShareTargetRole" + } + } + }, + "PluginShareTargetRole": { + "type": "string", + "enum": [ + "reader", + "editor" + ] + }, + "PluginShareUpdateDiscoverability": { + "type": "string", + "enum": [ + "UNLISTED", + "PRIVATE" + ] + }, + "PluginShareUpdateTargetsParams": { + "type": "object", + "required": [ + "discoverability", + "remotePluginId", + "shareTargets" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/PluginShareUpdateDiscoverability" + }, + "remotePluginId": { + "type": "string" + }, + "shareTargets": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + } + }, + "PluginSkillReadParams": { + "type": "object", + "required": [ + "remoteMarketplaceName", + "remotePluginId", + "skillName" + ], + "properties": { + "remoteMarketplaceName": { + "type": "string" + }, + "remotePluginId": { + "type": "string" + }, + "skillName": { + "type": "string" + } + } + }, + "PluginUninstallParams": { + "type": "object", + "required": [ + "pluginId" + ], + "properties": { + "pluginId": { + "type": "string" + } + } + }, + "PluginsMigration": { + "type": "object", + "required": [ + "marketplaceName", + "pluginNames" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "pluginNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "TurnInterruptParams": { + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnEnvironmentParams": { + "type": "object", + "required": [ + "cwd", + "environmentId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "environmentId": { + "type": "string" + } + } + }, + "ThreadUnsubscribeParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ProcessTerminalSize": { + "description": "PTY size in character cells for `process/spawn` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "ThreadUnarchiveParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "RealtimeOutputModality": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "RealtimeVoice": { + "type": "string", + "enum": [ + "alloy", + "arbor", + "ash", + "ballad", + "breeze", + "cedar", + "coral", + "cove", + "echo", + "ember", + "juniper", + "maple", + "marin", + "sage", + "shimmer", + "sol", + "spruce", + "vale", + "verse" + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType" + } + }, + "title": "ReasoningTextReasoningItemContent" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType" + } + }, + "title": "TextReasoningItemContent" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType" + } + }, + "title": "SummaryTextReasoningItemReasoningSummary" + } + ] + }, + "ReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItem" + } + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "title": "MessageResponseItemType" + } + }, + "title": "MessageResponseItem" + }, + { + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType" + } + }, + "title": "ReasoningResponseItem" + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType" + } + }, + "title": "LocalShellCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType" + } + }, + "title": "FunctionCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "execution", + "type" + ], + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType" + } + }, + "title": "ToolSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType" + } + }, + "title": "FunctionCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType" + } + }, + "title": "CustomToolCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType" + } + }, + "title": "CustomToolCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "execution", + "status", + "tools", + "type" + ], + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "type": "array", + "items": true + }, + "type": { + "type": "string", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType" + } + }, + "title": "ToolSearchOutputResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType" + } + }, + "title": "WebSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType" + } + }, + "title": "ImageGenerationCallResponseItem" + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType" + } + }, + "title": "CompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType" + } + }, + "title": "CompactionTriggerResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType" + } + }, + "title": "ContextCompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponseItemType" + } + }, + "title": "OtherResponseItem" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType" + } + }, + "title": "SearchResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType" + } + }, + "title": "OtherResponsesApiWebSearchAction" + } + ] + }, + "ReviewDelivery": { + "type": "string", + "enum": [ + "inline", + "detached" + ] + }, + "ReviewStartParams": { + "type": "object", + "required": [ + "target", + "threadId" + ], + "properties": { + "delivery": { + "description": "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ReviewDelivery" + }, + { + "type": "null" + } + ] + }, + "target": { + "$ref": "#/definitions/ReviewTarget" + }, + "threadId": { + "type": "string" + } + } + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "uncommittedChanges" + ], + "title": "UncommittedChangesReviewTargetType" + } + }, + "title": "UncommittedChangesReviewTarget" + }, + { + "description": "Review changes between the current branch and the given base branch.", + "type": "object", + "required": [ + "branch", + "type" + ], + "properties": { + "branch": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "baseBranch" + ], + "title": "BaseBranchReviewTargetType" + } + }, + "title": "BaseBranchReviewTarget" + }, + { + "description": "Review the changes introduced by a specific commit.", + "type": "object", + "required": [ + "sha", + "type" + ], + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "commit" + ], + "title": "CommitReviewTargetType" + } + }, + "title": "CommitReviewTarget" + }, + { + "description": "Arbitrary instructions, equivalent to the old free-form prompt.", + "type": "object", + "required": [ + "instructions", + "type" + ], + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ], + "title": "CustomReviewTargetType" + } + }, + "title": "CustomReviewTarget" + } + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "SendAddCreditsNudgeEmailParams": { + "type": "object", + "required": [ + "creditType" + ], + "properties": { + "creditType": { + "$ref": "#/definitions/AddCreditsNudgeCreditType" + } + } + }, + "SessionMigration": { + "type": "object", + "required": [ + "cwd", + "path" + ], + "properties": { + "cwd": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "type": "object", + "required": [ + "model" + ], + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + } + }, + "SkillsConfigWriteParams": { + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "description": "Name-based selector.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Path-based selector.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + } + } + }, + "SkillsListParams": { + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + }, + "forceReload": { + "description": "When true, bypass the skills cache and re-scan skills from disk.", + "type": "boolean" + } + } + }, + "SortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "SubagentMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadApproveGuardianDeniedActionParams": { + "type": "object", + "required": [ + "event", + "threadId" + ], + "properties": { + "event": { + "description": "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`." + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadArchiveParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadResumeParams": { + "description": "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nThe precedence is: history > path > thread_id. If using history or path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "model": { + "description": "Configuration overrides for the resumed thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadCompactStartParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeStartTransport": { + "description": "EXPERIMENTAL - transport used by thread realtime.", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ], + "title": "WebsocketThreadRealtimeStartTransportType" + } + }, + "title": "WebsocketThreadRealtimeStartTransport" + }, + { + "type": "object", + "required": [ + "sdp", + "type" + ], + "properties": { + "sdp": { + "description": "SDP offer generated by a WebRTC RTCPeerConnection after configuring audio and the realtime events data channel.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webrtc" + ], + "title": "WebrtcThreadRealtimeStartTransportType" + } + }, + "title": "WebrtcThreadRealtimeStartTransport" + } + ] + }, + "ThreadForkParams": { + "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "ephemeral": { + "type": "boolean" + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this forked thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "model": { + "description": "Configuration overrides for the forked thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadStartSource": { + "type": "string", + "enum": [ + "startup", + "clear" + ] + }, + "ThreadStartParams": { + "type": "object", + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sessionStartSource": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadStartSource" + }, + { + "type": "null" + } + ] + }, + "ephemeral": { + "type": [ + "boolean", + "null" + ] + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "serviceName": { + "type": [ + "string", + "null" + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadSourceKind": { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown" + ] + }, + "ThreadGoalStatus": { + "type": "string", + "enum": [ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete" + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadInjectItemsParams": { + "type": "object", + "required": [ + "items", + "threadId" + ], + "properties": { + "items": { + "description": "Raw Responses API items to append to the thread's model-visible history.", + "type": "array", + "items": true + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadListCwdFilter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ThreadListParams": { + "type": "object", + "properties": { + "archived": { + "description": "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", + "type": [ + "boolean", + "null" + ] + }, + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadListCwdFilter" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "modelProviders": { + "description": "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "searchTerm": { + "description": "Optional substring filter for the extracted thread title.", + "type": [ + "string", + "null" + ] + }, + "sortDirection": { + "description": "Optional sort direction; defaults to descending (newest first).", + "anyOf": [ + { + "$ref": "#/definitions/SortDirection" + }, + { + "type": "null" + } + ] + }, + "sortKey": { + "description": "Optional sort key; defaults to created_at.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSortKey" + }, + { + "type": "null" + } + ] + }, + "sourceKinds": { + "description": "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ThreadSourceKind" + } + }, + "useStateDbOnly": { + "description": "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", + "type": "boolean" + } + } + }, + "ThreadLoadedListParams": { + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to no limit.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadMemoryMode": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + }, + "ThreadSortKey": { + "type": "string", + "enum": [ + "created_at", + "updated_at" + ] + }, + "ThreadMetadataGitInfoUpdateParams": { + "type": "object", + "properties": { + "branch": { + "description": "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "description": "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadMetadataUpdateParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "gitInfo": { + "description": "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadMetadataGitInfoUpdateParams" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadReadParams": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "includeTurns": { + "description": "When true, include turns and their items from rollout history.", + "default": false, + "type": "boolean" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadShellCommandParams": { + "type": "object", + "required": [ + "command", + "threadId" + ], + "properties": { + "command": { + "description": "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadSetNameParams": { + "type": "object", + "required": [ + "name", + "threadId" + ], + "properties": { + "name": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeAudioChunk": { + "description": "EXPERIMENTAL - thread realtime audio chunk.", + "type": "object", + "required": [ + "data", + "numChannels", + "sampleRate" + ], + "properties": { + "data": { + "type": "string" + }, + "itemId": { + "type": [ + "string", + "null" + ] + }, + "numChannels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sampleRate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samplesPerChannel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadRollbackParams": { + "type": "object", + "required": [ + "numTurns", + "threadId" + ], + "properties": { + "numTurns": { + "description": "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/CommandExecutionRequestApprovalParams.json b/schemas/CommandExecutionRequestApprovalParams.json new file mode 100644 index 0000000..2044038 --- /dev/null +++ b/schemas/CommandExecutionRequestApprovalParams.json @@ -0,0 +1,616 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionRequestApprovalParams", + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + }, + "approvalId": { + "description": "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "type": [ + "string", + "null" + ] + }, + "commandActions": { + "description": "Best-effort parsed command actions for friendly display.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "itemId": { + "type": "string" + }, + "networkApprovalContext": { + "description": "Optional context for a managed-network approval prompt.", + "anyOf": [ + { + "$ref": "#/definitions/NetworkApprovalContext" + }, + { + "type": "null" + } + ] + }, + "proposedExecpolicyAmendment": { + "description": "Optional proposed execpolicy amendment to allow similar commands without prompting.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "proposedNetworkPolicyAmendments": { + "description": "Optional proposed network policy amendments (allow/deny host) for future requests.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for network access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AdditionalPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "description": "Partial overlay used for per-command permission requests.", + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionApprovalDecision": { + "oneOf": [ + { + "description": "User approved the command.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", + "type": "object", + "required": [ + "acceptWithExecpolicyAmendment" + ], + "properties": { + "acceptWithExecpolicyAmendment": { + "type": "object", + "required": [ + "execpolicy_amendment" + ], + "properties": { + "execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User chose a persistent network policy rule (allow/deny) for this host.", + "type": "object", + "required": [ + "applyNetworkPolicyAmendment" + ], + "properties": { + "applyNetworkPolicyAmendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User denied the command. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the command. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "NetworkApprovalContext": { + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "host": { + "type": "string" + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + } + } + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + } + } +} \ No newline at end of file diff --git a/schemas/CommandExecutionRequestApprovalResponse.json b/schemas/CommandExecutionRequestApprovalResponse.json new file mode 100644 index 0000000..60036c0 --- /dev/null +++ b/schemas/CommandExecutionRequestApprovalResponse.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionRequestApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/CommandExecutionApprovalDecision" + } + }, + "definitions": { + "CommandExecutionApprovalDecision": { + "oneOf": [ + { + "description": "User approved the command.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", + "type": "object", + "required": [ + "acceptWithExecpolicyAmendment" + ], + "properties": { + "acceptWithExecpolicyAmendment": { + "type": "object", + "required": [ + "execpolicy_amendment" + ], + "properties": { + "execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User chose a persistent network policy rule (allow/deny) for this host.", + "type": "object", + "required": [ + "applyNetworkPolicyAmendment" + ], + "properties": { + "applyNetworkPolicyAmendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User denied the command. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the command. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + }, + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + } + } +} \ No newline at end of file diff --git a/schemas/DynamicToolCallParams.json b/schemas/DynamicToolCallParams.json new file mode 100644 index 0000000..7ffebbe --- /dev/null +++ b/schemas/DynamicToolCallParams.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DynamicToolCallParams", + "type": "object", + "required": [ + "arguments", + "callId", + "threadId", + "tool", + "turnId" + ], + "properties": { + "arguments": true, + "callId": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/DynamicToolCallResponse.json b/schemas/DynamicToolCallResponse.json new file mode 100644 index 0000000..e168790 --- /dev/null +++ b/schemas/DynamicToolCallResponse.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DynamicToolCallResponse", + "type": "object", + "required": [ + "contentItems", + "success" + ], + "properties": { + "contentItems": { + "type": "array", + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "success": { + "type": "boolean" + } + }, + "definitions": { + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/ExecCommandApprovalParams.json b/schemas/ExecCommandApprovalParams.json new file mode 100644 index 0000000..aee3033 --- /dev/null +++ b/schemas/ExecCommandApprovalParams.json @@ -0,0 +1,165 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecCommandApprovalParams", + "type": "object", + "required": [ + "callId", + "command", + "conversationId", + "cwd", + "parsedCmd" + ], + "properties": { + "approvalId": { + "description": "Identifier for this specific approval callback.", + "type": [ + "string", + "null" + ] + }, + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] and [codex_protocol::protocol::ExecCommandEndEvent].", + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "conversationId": { + "$ref": "#/definitions/ThreadId" + }, + "cwd": { + "type": "string" + }, + "parsedCmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "reason": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "ParsedCommand": { + "oneOf": [ + { + "type": "object", + "required": [ + "cmd", + "name", + "path", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "description": "(Best effort) Path to the file being read by the command. When possible, this is an absolute path, though when relative, it should be resolved against the `cwd`` that will be used to run the command to derive the absolute path.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadParsedCommandType" + } + }, + "title": "ReadParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "list_files" + ], + "title": "ListFilesParsedCommandType" + } + }, + "title": "ListFilesParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchParsedCommandType" + } + }, + "title": "SearchParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownParsedCommandType" + } + }, + "title": "UnknownParsedCommand" + } + ] + }, + "ThreadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/ExecCommandApprovalResponse.json b/schemas/ExecCommandApprovalResponse.json new file mode 100644 index 0000000..abafe36 --- /dev/null +++ b/schemas/ExecCommandApprovalResponse.json @@ -0,0 +1,124 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecCommandApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/ReviewDecision" + } + }, + "definitions": { + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "ReviewDecision": { + "description": "User's decision in response to an ExecApprovalRequest.", + "oneOf": [ + { + "description": "User has approved this command and the agent should execute it.", + "type": "string", + "enum": [ + "approved" + ] + }, + { + "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + "type": "object", + "required": [ + "approved_execpolicy_amendment" + ], + "properties": { + "approved_execpolicy_amendment": { + "type": "object", + "required": [ + "proposed_execpolicy_amendment" + ], + "properties": { + "proposed_execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "ApprovedExecpolicyAmendmentReviewDecision" + }, + { + "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + "type": "string", + "enum": [ + "approved_for_session" + ] + }, + { + "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "NetworkPolicyAmendmentReviewDecision" + }, + { + "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "type": "string", + "enum": [ + "denied" + ] + }, + { + "description": "Automatic approval review timed out before reaching a decision.", + "type": "string", + "enum": [ + "timed_out" + ] + }, + { + "description": "User has denied this command and the agent should not do anything until the user's next command.", + "type": "string", + "enum": [ + "abort" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/FileChangeRequestApprovalParams.json b/schemas/FileChangeRequestApprovalParams.json new file mode 100644 index 0000000..a8f4fa5 --- /dev/null +++ b/schemas/FileChangeRequestApprovalParams.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeRequestApprovalParams", + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "grantRoot": { + "description": "[UNSTABLE] When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "itemId": { + "type": "string" + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/FileChangeRequestApprovalResponse.json b/schemas/FileChangeRequestApprovalResponse.json new file mode 100644 index 0000000..ace7740 --- /dev/null +++ b/schemas/FileChangeRequestApprovalResponse.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeRequestApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/FileChangeApprovalDecision" + } + }, + "definitions": { + "FileChangeApprovalDecision": { + "oneOf": [ + { + "description": "User approved the file changes.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the file changes and future changes to the same files should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User denied the file changes. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the file changes. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/FuzzyFileSearchParams.json b/schemas/FuzzyFileSearchParams.json new file mode 100644 index 0000000..0607856 --- /dev/null +++ b/schemas/FuzzyFileSearchParams.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchParams", + "type": "object", + "required": [ + "query", + "roots" + ], + "properties": { + "cancellationToken": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": "string" + }, + "roots": { + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schemas/FuzzyFileSearchResponse.json b/schemas/FuzzyFileSearchResponse.json new file mode 100644 index 0000000..808171a --- /dev/null +++ b/schemas/FuzzyFileSearchResponse.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchResponse", + "type": "object", + "required": [ + "files" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + } + }, + "definitions": { + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "FuzzyFileSearchResult": { + "description": "Superset of [`codex_file_search::FileMatch`]", + "type": "object", + "required": [ + "file_name", + "match_type", + "path", + "root", + "score" + ], + "properties": { + "file_name": { + "type": "string" + }, + "indices": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "match_type": { + "$ref": "#/definitions/FuzzyFileSearchMatchType" + }, + "path": { + "type": "string" + }, + "root": { + "type": "string" + }, + "score": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/schemas/FuzzyFileSearchSessionCompletedNotification.json b/schemas/FuzzyFileSearchSessionCompletedNotification.json new file mode 100644 index 0000000..2312b21 --- /dev/null +++ b/schemas/FuzzyFileSearchSessionCompletedNotification.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionCompletedNotification", + "type": "object", + "required": [ + "sessionId" + ], + "properties": { + "sessionId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/FuzzyFileSearchSessionUpdatedNotification.json b/schemas/FuzzyFileSearchSessionUpdatedNotification.json new file mode 100644 index 0000000..d1babb0 --- /dev/null +++ b/schemas/FuzzyFileSearchSessionUpdatedNotification.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionUpdatedNotification", + "type": "object", + "required": [ + "files", + "query", + "sessionId" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + }, + "query": { + "type": "string" + }, + "sessionId": { + "type": "string" + } + }, + "definitions": { + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "FuzzyFileSearchResult": { + "description": "Superset of [`codex_file_search::FileMatch`]", + "type": "object", + "required": [ + "file_name", + "match_type", + "path", + "root", + "score" + ], + "properties": { + "file_name": { + "type": "string" + }, + "indices": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "match_type": { + "$ref": "#/definitions/FuzzyFileSearchMatchType" + }, + "path": { + "type": "string" + }, + "root": { + "type": "string" + }, + "score": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/schemas/JSONRPCError.json b/schemas/JSONRPCError.json new file mode 100644 index 0000000..54cc21b --- /dev/null +++ b/schemas/JSONRPCError.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCError", + "description": "A response to a request that indicates an error occurred.", + "type": "object", + "required": [ + "error", + "id" + ], + "properties": { + "error": { + "$ref": "#/definitions/JSONRPCErrorError" + }, + "id": { + "$ref": "#/definitions/RequestId" + } + }, + "definitions": { + "JSONRPCErrorError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "data": true, + "message": { + "type": "string" + } + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/JSONRPCErrorError.json b/schemas/JSONRPCErrorError.json new file mode 100644 index 0000000..3259450 --- /dev/null +++ b/schemas/JSONRPCErrorError.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCErrorError", + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "data": true, + "message": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/JSONRPCMessage.json b/schemas/JSONRPCMessage.json new file mode 100644 index 0000000..cb4a673 --- /dev/null +++ b/schemas/JSONRPCMessage.json @@ -0,0 +1,137 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCMessage", + "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.", + "anyOf": [ + { + "$ref": "#/definitions/JSONRPCRequest" + }, + { + "$ref": "#/definitions/JSONRPCNotification" + }, + { + "$ref": "#/definitions/JSONRPCResponse" + }, + { + "$ref": "#/definitions/JSONRPCError" + } + ], + "definitions": { + "JSONRPCError": { + "description": "A response to a request that indicates an error occurred.", + "type": "object", + "required": [ + "error", + "id" + ], + "properties": { + "error": { + "$ref": "#/definitions/JSONRPCErrorError" + }, + "id": { + "$ref": "#/definitions/RequestId" + } + } + }, + "JSONRPCErrorError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "data": true, + "message": { + "type": "string" + } + } + }, + "JSONRPCNotification": { + "description": "A notification which does not expect a response.", + "type": "object", + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string" + }, + "params": true + } + }, + "JSONRPCRequest": { + "description": "A request that expects a response.", + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string" + }, + "params": true, + "trace": { + "description": "Optional W3C Trace Context for distributed tracing.", + "anyOf": [ + { + "$ref": "#/definitions/W3cTraceContext" + }, + { + "type": "null" + } + ] + } + } + }, + "JSONRPCResponse": { + "description": "A successful (non-error) response to a request.", + "type": "object", + "required": [ + "id", + "result" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "result": true + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "W3cTraceContext": { + "type": "object", + "properties": { + "traceparent": { + "type": [ + "string", + "null" + ] + }, + "tracestate": { + "type": [ + "string", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/JSONRPCNotification.json b/schemas/JSONRPCNotification.json new file mode 100644 index 0000000..8d36713 --- /dev/null +++ b/schemas/JSONRPCNotification.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCNotification", + "description": "A notification which does not expect a response.", + "type": "object", + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string" + }, + "params": true + } +} \ No newline at end of file diff --git a/schemas/JSONRPCRequest.json b/schemas/JSONRPCRequest.json new file mode 100644 index 0000000..6fc6d65 --- /dev/null +++ b/schemas/JSONRPCRequest.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCRequest", + "description": "A request that expects a response.", + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string" + }, + "params": true, + "trace": { + "description": "Optional W3C Trace Context for distributed tracing.", + "anyOf": [ + { + "$ref": "#/definitions/W3cTraceContext" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "W3cTraceContext": { + "type": "object", + "properties": { + "traceparent": { + "type": [ + "string", + "null" + ] + }, + "tracestate": { + "type": [ + "string", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/JSONRPCResponse.json b/schemas/JSONRPCResponse.json new file mode 100644 index 0000000..86a74bd --- /dev/null +++ b/schemas/JSONRPCResponse.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCResponse", + "description": "A successful (non-error) response to a request.", + "type": "object", + "required": [ + "id", + "result" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "result": true + }, + "definitions": { + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/McpServerElicitationRequestParams.json b/schemas/McpServerElicitationRequestParams.json new file mode 100644 index 0000000..44ec7e0 --- /dev/null +++ b/schemas/McpServerElicitationRequestParams.json @@ -0,0 +1,609 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerElicitationRequestParams", + "type": "object", + "oneOf": [ + { + "type": "object", + "required": [ + "message", + "mode", + "requestedSchema" + ], + "properties": { + "_meta": true, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "form" + ] + }, + "requestedSchema": { + "$ref": "#/definitions/McpElicitationSchema" + } + } + }, + { + "type": "object", + "required": [ + "elicitationId", + "message", + "mode", + "url" + ], + "properties": { + "_meta": true, + "elicitationId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "url" + ] + }, + "url": { + "type": "string" + } + } + } + ], + "required": [ + "serverName", + "threadId" + ], + "properties": { + "serverName": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "description": "Active Codex turn when this elicitation was observed, if app-server could correlate one.\n\nThis is nullable because MCP models elicitation as a standalone server-to-client request identified by the MCP server request id. It may be triggered during a turn, but turn context is app-server correlation rather than part of the protocol identity of the elicitation itself.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "McpElicitationArrayType": { + "type": "string", + "enum": [ + "array" + ] + }, + "McpElicitationBooleanSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "boolean", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationBooleanType" + } + }, + "additionalProperties": false + }, + "McpElicitationBooleanType": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "McpElicitationConstOption": { + "type": "object", + "required": [ + "const", + "title" + ], + "properties": { + "const": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "McpElicitationEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationLegacyTitledEnumSchema" + } + ] + }, + "McpElicitationLegacyTitledEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "enumNames": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationMultiSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledMultiSelectEnumSchema" + } + ] + }, + "McpElicitationNumberSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "maximum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "minimum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationNumberType" + } + }, + "additionalProperties": false + }, + "McpElicitationNumberType": { + "type": "string", + "enum": [ + "number", + "integer" + ] + }, + "McpElicitationObjectType": { + "type": "string", + "enum": [ + "object" + ] + }, + "McpElicitationPrimitiveSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationStringSchema" + }, + { + "$ref": "#/definitions/McpElicitationNumberSchema" + }, + { + "$ref": "#/definitions/McpElicitationBooleanSchema" + } + ] + }, + "McpElicitationSchema": { + "description": "Typed form schema for MCP `elicitation/create` requests.\n\nThis matches the `requestedSchema` shape from the MCP 2025-11-25 `ElicitRequestFormParams` schema.", + "type": "object", + "required": [ + "properties", + "type" + ], + "properties": { + "$schema": { + "type": [ + "string", + "null" + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/McpElicitationPrimitiveSchema" + } + }, + "required": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationObjectType" + } + }, + "additionalProperties": false + }, + "McpElicitationSingleSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledSingleSelectEnumSchema" + } + ] + }, + "McpElicitationStringFormat": { + "type": "string", + "enum": [ + "email", + "uri", + "date", + "date-time" + ] + }, + "McpElicitationStringSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "format": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationStringFormat" + }, + { + "type": "null" + } + ] + }, + "maxLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "minLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationStringType": { + "type": "string", + "enum": [ + "string" + ] + }, + "McpElicitationTitledEnumItems": { + "type": "object", + "required": [ + "anyOf" + ], + "properties": { + "anyOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + } + }, + "additionalProperties": false + }, + "McpElicitationTitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationTitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationTitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "oneOf", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledEnumItems": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationUntitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/McpServerElicitationRequestResponse.json b/schemas/McpServerElicitationRequestResponse.json new file mode 100644 index 0000000..f0fe310 --- /dev/null +++ b/schemas/McpServerElicitationRequestResponse.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerElicitationRequestResponse", + "type": "object", + "required": [ + "action" + ], + "properties": { + "_meta": { + "description": "Optional client metadata for form-mode action handling." + }, + "action": { + "$ref": "#/definitions/McpServerElicitationAction" + }, + "content": { + "description": "Structured user input for accepted elicitations, mirroring RMCP `CreateElicitationResult`.\n\nThis is nullable because decline/cancel responses have no content." + } + }, + "definitions": { + "McpServerElicitationAction": { + "type": "string", + "enum": [ + "accept", + "decline", + "cancel" + ] + } + } +} \ No newline at end of file diff --git a/schemas/PermissionsRequestApprovalParams.json b/schemas/PermissionsRequestApprovalParams.json new file mode 100644 index 0000000..f0c2208 --- /dev/null +++ b/schemas/PermissionsRequestApprovalParams.json @@ -0,0 +1,322 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionsRequestApprovalParams", + "type": "object", + "required": [ + "cwd", + "itemId", + "permissions", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "itemId": { + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/PermissionsRequestApprovalResponse.json b/schemas/PermissionsRequestApprovalResponse.json new file mode 100644 index 0000000..5b527c8 --- /dev/null +++ b/schemas/PermissionsRequestApprovalResponse.json @@ -0,0 +1,315 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionsRequestApprovalResponse", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/GrantedPermissionProfile" + }, + "scope": { + "default": "turn", + "allOf": [ + { + "$ref": "#/definitions/PermissionGrantScope" + } + ] + }, + "strictAutoReview": { + "description": "Review every subsequent command in this turn before normal sandboxed execution.", + "type": [ + "boolean", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "GrantedPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "PermissionGrantScope": { + "type": "string", + "enum": [ + "turn", + "session" + ] + } + } +} \ No newline at end of file diff --git a/schemas/RequestId.json b/schemas/RequestId.json new file mode 100644 index 0000000..8cb7b94 --- /dev/null +++ b/schemas/RequestId.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RequestId", + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] +} \ No newline at end of file diff --git a/schemas/ServerNotification.json b/schemas/ServerNotification.json new file mode 100644 index 0000000..49b7f14 --- /dev/null +++ b/schemas/ServerNotification.json @@ -0,0 +1,6160 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerNotification", + "description": "Notification sent from the server to the client.", + "oneOf": [ + { + "description": "NEW NOTIFICATIONS", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "error" + ], + "title": "ErrorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ErrorNotification" + } + }, + "title": "ErrorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/started" + ], + "title": "Thread/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStartedNotification" + } + }, + "title": "Thread/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/status/changed" + ], + "title": "Thread/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStatusChangedNotification" + } + }, + "title": "Thread/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/archived" + ], + "title": "Thread/archivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadArchivedNotification" + } + }, + "title": "Thread/archivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/unarchived" + ], + "title": "Thread/unarchivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnarchivedNotification" + } + }, + "title": "Thread/unarchivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/closed" + ], + "title": "Thread/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadClosedNotification" + } + }, + "title": "Thread/closedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "skills/changed" + ], + "title": "Skills/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/SkillsChangedNotification" + } + }, + "title": "Skills/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/name/updated" + ], + "title": "Thread/name/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadNameUpdatedNotification" + } + }, + "title": "Thread/name/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/updated" + ], + "title": "Thread/goal/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadGoalUpdatedNotification" + } + }, + "title": "Thread/goal/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/cleared" + ], + "title": "Thread/goal/clearedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadGoalClearedNotification" + } + }, + "title": "Thread/goal/clearedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/tokenUsage/updated" + ], + "title": "Thread/tokenUsage/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadTokenUsageUpdatedNotification" + } + }, + "title": "Thread/tokenUsage/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/started" + ], + "title": "Turn/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnStartedNotification" + } + }, + "title": "Turn/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/started" + ], + "title": "Hook/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/HookStartedNotification" + } + }, + "title": "Hook/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/completed" + ], + "title": "Turn/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnCompletedNotification" + } + }, + "title": "Turn/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/completed" + ], + "title": "Hook/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/HookCompletedNotification" + } + }, + "title": "Hook/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/diff/updated" + ], + "title": "Turn/diff/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnDiffUpdatedNotification" + } + }, + "title": "Turn/diff/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/plan/updated" + ], + "title": "Turn/plan/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnPlanUpdatedNotification" + } + }, + "title": "Turn/plan/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/started" + ], + "title": "Item/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemStartedNotification" + } + }, + "title": "Item/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/started" + ], + "title": "Item/autoApprovalReview/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemGuardianApprovalReviewStartedNotification" + } + }, + "title": "Item/autoApprovalReview/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/completed" + ], + "title": "Item/autoApprovalReview/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemGuardianApprovalReviewCompletedNotification" + } + }, + "title": "Item/autoApprovalReview/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/completed" + ], + "title": "Item/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemCompletedNotification" + } + }, + "title": "Item/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/agentMessage/delta" + ], + "title": "Item/agentMessage/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AgentMessageDeltaNotification" + } + }, + "title": "Item/agentMessage/deltaNotification" + }, + { + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/plan/delta" + ], + "title": "Item/plan/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/PlanDeltaNotification" + } + }, + "title": "Item/plan/deltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `command/exec` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "command/exec/outputDelta" + ], + "title": "Command/exec/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecOutputDeltaNotification" + } + }, + "title": "Command/exec/outputDeltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/outputDelta" + ], + "title": "Process/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ProcessOutputDeltaNotification" + } + }, + "title": "Process/outputDeltaNotification" + }, + { + "description": "Final exit notification for a `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/exited" + ], + "title": "Process/exitedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ProcessExitedNotification" + } + }, + "title": "Process/exitedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/outputDelta" + ], + "title": "Item/commandExecution/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecutionOutputDeltaNotification" + } + }, + "title": "Item/commandExecution/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/terminalInteraction" + ], + "title": "Item/commandExecution/terminalInteractionNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TerminalInteractionNotification" + } + }, + "title": "Item/commandExecution/terminalInteractionNotification" + }, + { + "description": "Deprecated legacy apply_patch output stream notification.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/outputDelta" + ], + "title": "Item/fileChange/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FileChangeOutputDeltaNotification" + } + }, + "title": "Item/fileChange/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/patchUpdated" + ], + "title": "Item/fileChange/patchUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FileChangePatchUpdatedNotification" + } + }, + "title": "Item/fileChange/patchUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "serverRequest/resolved" + ], + "title": "ServerRequest/resolvedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ServerRequestResolvedNotification" + } + }, + "title": "ServerRequest/resolvedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/mcpToolCall/progress" + ], + "title": "Item/mcpToolCall/progressNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpToolCallProgressNotification" + } + }, + "title": "Item/mcpToolCall/progressNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/oauthLogin/completed" + ], + "title": "McpServer/oauthLogin/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpServerOauthLoginCompletedNotification" + } + }, + "title": "McpServer/oauthLogin/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/startupStatus/updated" + ], + "title": "McpServer/startupStatus/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpServerStatusUpdatedNotification" + } + }, + "title": "McpServer/startupStatus/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/updated" + ], + "title": "Account/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountUpdatedNotification" + } + }, + "title": "Account/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/rateLimits/updated" + ], + "title": "Account/rateLimits/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountRateLimitsUpdatedNotification" + } + }, + "title": "Account/rateLimits/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "app/list/updated" + ], + "title": "App/list/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AppListUpdatedNotification" + } + }, + "title": "App/list/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "remoteControl/status/changed" + ], + "title": "RemoteControl/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/RemoteControlStatusChangedNotification" + } + }, + "title": "RemoteControl/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import/completed" + ], + "title": "ExternalAgentConfig/import/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigImportCompletedNotification" + } + }, + "title": "ExternalAgentConfig/import/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fs/changed" + ], + "title": "Fs/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FsChangedNotification" + } + }, + "title": "Fs/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryTextDelta" + ], + "title": "Item/reasoning/summaryTextDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningSummaryTextDeltaNotification" + } + }, + "title": "Item/reasoning/summaryTextDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryPartAdded" + ], + "title": "Item/reasoning/summaryPartAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningSummaryPartAddedNotification" + } + }, + "title": "Item/reasoning/summaryPartAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/textDelta" + ], + "title": "Item/reasoning/textDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningTextDeltaNotification" + } + }, + "title": "Item/reasoning/textDeltaNotification" + }, + { + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/compacted" + ], + "title": "Thread/compactedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ContextCompactedNotification" + } + }, + "title": "Thread/compactedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/rerouted" + ], + "title": "Model/reroutedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ModelReroutedNotification" + } + }, + "title": "Model/reroutedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/verification" + ], + "title": "Model/verificationNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ModelVerificationNotification" + } + }, + "title": "Model/verificationNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "warning" + ], + "title": "WarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WarningNotification" + } + }, + "title": "WarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "guardianWarning" + ], + "title": "GuardianWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/GuardianWarningNotification" + } + }, + "title": "GuardianWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "deprecationNotice" + ], + "title": "DeprecationNoticeNotificationMethod" + }, + "params": { + "$ref": "#/definitions/DeprecationNoticeNotification" + } + }, + "title": "DeprecationNoticeNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "configWarning" + ], + "title": "ConfigWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ConfigWarningNotification" + } + }, + "title": "ConfigWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionUpdated" + ], + "title": "FuzzyFileSearch/sessionUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionUpdatedNotification" + } + }, + "title": "FuzzyFileSearch/sessionUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionCompleted" + ], + "title": "FuzzyFileSearch/sessionCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionCompletedNotification" + } + }, + "title": "FuzzyFileSearch/sessionCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/started" + ], + "title": "Thread/realtime/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeStartedNotification" + } + }, + "title": "Thread/realtime/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/itemAdded" + ], + "title": "Thread/realtime/itemAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeItemAddedNotification" + } + }, + "title": "Thread/realtime/itemAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/delta" + ], + "title": "Thread/realtime/transcript/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeTranscriptDeltaNotification" + } + }, + "title": "Thread/realtime/transcript/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/done" + ], + "title": "Thread/realtime/transcript/doneNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeTranscriptDoneNotification" + } + }, + "title": "Thread/realtime/transcript/doneNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/outputAudio/delta" + ], + "title": "Thread/realtime/outputAudio/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeOutputAudioDeltaNotification" + } + }, + "title": "Thread/realtime/outputAudio/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/sdp" + ], + "title": "Thread/realtime/sdpNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeSdpNotification" + } + }, + "title": "Thread/realtime/sdpNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/error" + ], + "title": "Thread/realtime/errorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeErrorNotification" + } + }, + "title": "Thread/realtime/errorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/closed" + ], + "title": "Thread/realtime/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeClosedNotification" + } + }, + "title": "Thread/realtime/closedNotification" + }, + { + "description": "Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windows/worldWritableWarning" + ], + "title": "Windows/worldWritableWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WindowsWorldWritableWarningNotification" + } + }, + "title": "Windows/worldWritableWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupCompleted" + ], + "title": "WindowsSandbox/setupCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WindowsSandboxSetupCompletedNotification" + } + }, + "title": "WindowsSandbox/setupCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/login/completed" + ], + "title": "Account/login/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountLoginCompletedNotification" + } + }, + "title": "Account/login/completedNotification" + } + ], + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AccountLoginCompletedNotification": { + "type": "object", + "required": [ + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "loginId": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + } + } + }, + "AccountRateLimitsUpdatedNotification": { + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "$ref": "#/definitions/RateLimitSnapshot" + } + } + }, + "AccountUpdatedNotification": { + "type": "object", + "properties": { + "authMode": { + "anyOf": [ + { + "$ref": "#/definitions/AuthMode" + }, + { + "type": "null" + } + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + } + } + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AgentMessageDeltaNotification": { + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AgentPath": { + "type": "string" + }, + "AppBranding": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "isDiscoverableApp" + ], + "properties": { + "category": { + "type": [ + "string", + "null" + ] + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "isDiscoverableApp": { + "type": "boolean" + }, + "privacyPolicy": { + "type": [ + "string", + "null" + ] + }, + "termsOfService": { + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppInfo": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "appMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/AppMetadata" + }, + { + "type": "null" + } + ] + }, + "branding": { + "anyOf": [ + { + "$ref": "#/definitions/AppBranding" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "distributionChannel": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "isAccessible": { + "default": false, + "type": "boolean" + }, + "isEnabled": { + "description": "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + "default": true, + "type": "boolean" + }, + "labels": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "logoUrl": { + "type": [ + "string", + "null" + ] + }, + "logoUrlDark": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "pluginDisplayNames": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AppListUpdatedNotification": { + "description": "EXPERIMENTAL - notification emitted when the app list changes.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AppInfo" + } + } + } + }, + "AppMetadata": { + "type": "object", + "properties": { + "categories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "firstPartyRequiresInstall": { + "type": [ + "boolean", + "null" + ] + }, + "firstPartyType": { + "type": [ + "string", + "null" + ] + }, + "review": { + "anyOf": [ + { + "$ref": "#/definitions/AppReview" + }, + { + "type": "null" + } + ] + }, + "screenshots": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AppScreenshot" + } + }, + "seoDescription": { + "type": [ + "string", + "null" + ] + }, + "showInComposerWhenUnlinked": { + "type": [ + "boolean", + "null" + ] + }, + "subCategories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "version": { + "type": [ + "string", + "null" + ] + }, + "versionId": { + "type": [ + "string", + "null" + ] + }, + "versionNotes": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppReview": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string" + } + } + }, + "AppScreenshot": { + "type": "object", + "required": [ + "userPrompt" + ], + "properties": { + "fileId": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "userPrompt": { + "type": "string" + } + } + }, + "AuthMode": { + "description": "Authentication mode for OpenAI-backed providers.", + "oneOf": [ + { + "description": "OpenAI API key provided by the caller and stored by Codex.", + "type": "string", + "enum": [ + "apikey" + ] + }, + { + "description": "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + "type": "string", + "enum": [ + "chatgpt" + ] + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + "type": "string", + "enum": [ + "chatgptAuthTokens" + ] + }, + { + "description": "Programmatic Codex auth backed by a registered Agent Identity.", + "type": "string", + "enum": [ + "agentIdentity" + ] + } + ] + }, + "AutoReviewDecisionSource": { + "description": "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + "type": "string", + "enum": [ + "agent" + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecOutputDeltaNotification": { + "description": "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processId", + "stream" + ], + "properties": { + "capReached": { + "description": "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "stream": { + "description": "Output stream for this chunk.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecOutputStream" + } + ] + } + } + }, + "CommandExecOutputStream": { + "description": "Stream label for `command/exec/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "CommandExecutionOutputDeltaNotification": { + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "ConfigWarningNotification": { + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance or error details.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Optional path to the config file that triggered the warning.", + "type": [ + "string", + "null" + ] + }, + "range": { + "description": "Optional range for the error location inside the config file.", + "anyOf": [ + { + "$ref": "#/definitions/TextRange" + }, + { + "type": "null" + } + ] + }, + "summary": { + "description": "Concise summary of the warning.", + "type": "string" + } + } + }, + "ContextCompactedNotification": { + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "CreditsSnapshot": { + "type": "object", + "required": [ + "hasCredits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "hasCredits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "DeprecationNoticeNotification": { + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + } + } + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "ErrorNotification": { + "type": "object", + "required": [ + "error", + "threadId", + "turnId", + "willRetry" + ], + "properties": { + "error": { + "$ref": "#/definitions/TurnError" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "willRetry": { + "type": "boolean" + } + } + }, + "ExternalAgentConfigImportCompletedNotification": { + "type": "object" + }, + "FileChangeOutputDeltaNotification": { + "description": "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "FileChangePatchUpdatedNotification": { + "type": "object", + "required": [ + "changes", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "FsChangedNotification": { + "description": "Filesystem watch notification emitted for `fs/watch` subscribers.", + "type": "object", + "required": [ + "changedPaths", + "watchId" + ], + "properties": { + "changedPaths": { + "description": "File or directory paths associated with this event.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "FuzzyFileSearchResult": { + "description": "Superset of [`codex_file_search::FileMatch`]", + "type": "object", + "required": [ + "file_name", + "match_type", + "path", + "root", + "score" + ], + "properties": { + "file_name": { + "type": "string" + }, + "indices": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "match_type": { + "$ref": "#/definitions/FuzzyFileSearchMatchType" + }, + "path": { + "type": "string" + }, + "root": { + "type": "string" + }, + "score": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "FuzzyFileSearchSessionCompletedNotification": { + "type": "object", + "required": [ + "sessionId" + ], + "properties": { + "sessionId": { + "type": "string" + } + } + }, + "FuzzyFileSearchSessionUpdatedNotification": { + "type": "object", + "required": [ + "files", + "query", + "sessionId" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + }, + "query": { + "type": "string" + }, + "sessionId": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "GuardianApprovalReview": { + "description": "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "type": "object", + "required": [ + "status" + ], + "properties": { + "rationale": { + "type": [ + "string", + "null" + ] + }, + "riskLevel": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianRiskLevel" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/GuardianApprovalReviewStatus" + }, + "userAuthorization": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianUserAuthorization" + }, + { + "type": "null" + } + ] + } + } + }, + "GuardianApprovalReviewAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "cwd", + "source", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandGuardianApprovalReviewActionType" + } + }, + "title": "CommandGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "argv", + "cwd", + "program", + "source", + "type" + ], + "properties": { + "argv": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "program": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "execve" + ], + "title": "ExecveGuardianApprovalReviewActionType" + } + }, + "title": "ExecveGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "cwd", + "files", + "type" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "applyPatch" + ], + "title": "ApplyPatchGuardianApprovalReviewActionType" + } + }, + "title": "ApplyPatchGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "host", + "port", + "protocol", + "target", + "type" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + }, + "target": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "networkAccess" + ], + "title": "NetworkAccessGuardianApprovalReviewActionType" + } + }, + "title": "NetworkAccessGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "server", + "toolName", + "type" + ], + "properties": { + "connectorId": { + "type": [ + "string", + "null" + ] + }, + "connectorName": { + "type": [ + "string", + "null" + ] + }, + "server": { + "type": "string" + }, + "toolName": { + "type": "string" + }, + "toolTitle": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallGuardianApprovalReviewActionType" + } + }, + "title": "McpToolCallGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "permissions", + "type" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "requestPermissions" + ], + "title": "RequestPermissionsGuardianApprovalReviewActionType" + } + }, + "title": "RequestPermissionsGuardianApprovalReviewAction" + } + ] + }, + "GuardianApprovalReviewStatus": { + "description": "[UNSTABLE] Lifecycle state for an approval auto-review.", + "type": "string", + "enum": [ + "inProgress", + "approved", + "denied", + "timedOut", + "aborted" + ] + }, + "GuardianCommandSource": { + "type": "string", + "enum": [ + "shell", + "unifiedExec" + ] + }, + "GuardianRiskLevel": { + "description": "[UNSTABLE] Risk level assigned by approval auto-review.", + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "GuardianUserAuthorization": { + "description": "[UNSTABLE] Authorization level assigned by approval auto-review.", + "type": "string", + "enum": [ + "unknown", + "low", + "medium", + "high" + ] + }, + "GuardianWarningNotification": { + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "description": "Concise guardian warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Thread target for the guardian warning.", + "type": "string" + } + } + }, + "HookCompletedNotification": { + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "displayOrder", + "entries", + "eventName", + "executionMode", + "handlerType", + "id", + "scope", + "sourcePath", + "startedAt", + "status" + ], + "properties": { + "completedAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "durationMs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/HookOutputEntry" + } + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "executionMode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source": { + "default": "unknown", + "allOf": [ + { + "$ref": "#/definitions/HookSource" + } + ] + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "startedAt": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + }, + "HookStartedNotification": { + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "ItemCompletedNotification": { + "type": "object", + "required": [ + "completedAtMs", + "item", + "threadId", + "turnId" + ], + "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle completed.", + "type": "integer", + "format": "int64" + }, + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemGuardianApprovalReviewCompletedNotification": { + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "completedAtMs", + "decisionSource", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review completed.", + "type": "integer", + "format": "int64" + }, + "decisionSource": { + "$ref": "#/definitions/AutoReviewDecisionSource" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemGuardianApprovalReviewStartedNotification": { + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemStartedNotification": { + "type": "object", + "required": [ + "item", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "McpServerOauthLoginCompletedNotification": { + "type": "object", + "required": [ + "name", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "McpServerStartupState": { + "type": "string", + "enum": [ + "starting", + "ready", + "failed", + "cancelled" + ] + }, + "McpServerStatusUpdatedNotification": { + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpServerStartupState" + } + } + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallProgressNotification": { + "type": "object", + "required": [ + "itemId", + "message", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "ModelRerouteReason": { + "type": "string", + "enum": [ + "highRiskCyberActivity" + ] + }, + "ModelReroutedNotification": { + "type": "object", + "required": [ + "fromModel", + "reason", + "threadId", + "toModel", + "turnId" + ], + "properties": { + "fromModel": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/ModelRerouteReason" + }, + "threadId": { + "type": "string" + }, + "toModel": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ModelVerification": { + "type": "string", + "enum": [ + "trustedAccessForCyber" + ] + }, + "ModelVerificationNotification": { + "type": "object", + "required": [ + "threadId", + "turnId", + "verifications" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "verifications": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVerification" + } + } + } + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "PlanDeltaNotification": { + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + }, + "ProcessExitedNotification": { + "description": "Final process exit notification for `process/spawn`.", + "type": "object", + "required": [ + "exitCode", + "processHandle", + "stderr", + "stderrCapReached", + "stdout", + "stdoutCapReached" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `process/outputDelta`.", + "type": "string" + }, + "stderrCapReached": { + "description": "Whether stderr reached `outputBytesCap`.\n\nIn streaming mode, stderr is empty and cap state is also reported on the final stderr `process/outputDelta` notification.", + "type": "boolean" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `process/outputDelta`.", + "type": "string" + }, + "stdoutCapReached": { + "description": "Whether stdout reached `outputBytesCap`.\n\nIn streaming mode, stdout is empty and cap state is also reported on the final stdout `process/outputDelta` notification.", + "type": "boolean" + } + } + }, + "ProcessOutputDeltaNotification": { + "description": "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processHandle", + "stream" + ], + "properties": { + "capReached": { + "description": "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stream": { + "description": "Output stream this chunk belongs to.", + "allOf": [ + { + "$ref": "#/definitions/ProcessOutputStream" + } + ] + } + } + }, + "ProcessOutputStream": { + "description": "Stream label for `process/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "RateLimitReachedType": { + "type": "string", + "enum": [ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limitId": { + "type": [ + "string", + "null" + ] + }, + "limitName": { + "type": [ + "string", + "null" + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "rateLimitReachedType": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitReachedType" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "usedPercent" + ], + "properties": { + "resetsAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "usedPercent": { + "type": "integer", + "format": "int32" + }, + "windowDurationMins": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "RealtimeConversationVersion": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningSummaryPartAddedNotification": { + "type": "object", + "required": [ + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningSummaryTextDeltaNotification": { + "type": "object", + "required": [ + "delta", + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningTextDeltaNotification": { + "type": "object", + "required": [ + "contentIndex", + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "contentIndex": { + "type": "integer", + "format": "int64" + }, + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RemoteControlConnectionStatus": { + "type": "string", + "enum": [ + "disabled", + "connecting", + "connected", + "errored" + ] + }, + "RemoteControlStatusChangedNotification": { + "description": "Current remote-control connection status and remote identity exposed to clients.", + "type": "object", + "required": [ + "installationId", + "serverName", + "status" + ], + "properties": { + "environmentId": { + "type": [ + "string", + "null" + ] + }, + "installationId": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/RemoteControlConnectionStatus" + } + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ServerRequestResolvedNotification": { + "type": "object", + "required": [ + "requestId", + "threadId" + ], + "properties": { + "requestId": { + "$ref": "#/definitions/RequestId" + }, + "threadId": { + "type": "string" + } + } + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SkillsChangedNotification": { + "description": "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", + "type": "object" + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TerminalInteractionNotification": { + "type": "object", + "required": [ + "itemId", + "processId", + "stdin", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "processId": { + "type": "string" + }, + "stdin": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "TextPosition": { + "type": "object", + "required": [ + "column", + "line" + ], + "properties": { + "column": { + "description": "1-based column number (in Unicode scalar values).", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "line": { + "description": "1-based line number.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "TextRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "$ref": "#/definitions/TextPosition" + }, + "start": { + "$ref": "#/definitions/TextPosition" + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadArchivedNotification": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadClosedNotification": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadGoal": { + "type": "object", + "required": [ + "createdAt", + "objective", + "status", + "threadId", + "timeUsedSeconds", + "tokensUsed", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "objective": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/ThreadGoalStatus" + }, + "threadId": { + "type": "string" + }, + "timeUsedSeconds": { + "type": "integer", + "format": "int64" + }, + "tokenBudget": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "tokensUsed": { + "type": "integer", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "format": "int64" + } + } + }, + "ThreadGoalClearedNotification": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadGoalStatus": { + "type": "string", + "enum": [ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete" + ] + }, + "ThreadGoalUpdatedNotification": { + "type": "object", + "required": [ + "goal", + "threadId" + ], + "properties": { + "goal": { + "$ref": "#/definitions/ThreadGoal" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadNameUpdatedNotification": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "threadName": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadRealtimeAudioChunk": { + "description": "EXPERIMENTAL - thread realtime audio chunk.", + "type": "object", + "required": [ + "data", + "numChannels", + "sampleRate" + ], + "properties": { + "data": { + "type": "string" + }, + "itemId": { + "type": [ + "string", + "null" + ] + }, + "numChannels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sampleRate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samplesPerChannel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadRealtimeClosedNotification": { + "description": "EXPERIMENTAL - emitted when thread realtime transport closes.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeErrorNotification": { + "description": "EXPERIMENTAL - emitted when thread realtime encounters an error.", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeItemAddedNotification": { + "description": "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + "type": "object", + "required": [ + "item", + "threadId" + ], + "properties": { + "item": true, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeOutputAudioDeltaNotification": { + "description": "EXPERIMENTAL - streamed output audio emitted by thread realtime.", + "type": "object", + "required": [ + "audio", + "threadId" + ], + "properties": { + "audio": { + "$ref": "#/definitions/ThreadRealtimeAudioChunk" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeSdpNotification": { + "description": "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", + "type": "object", + "required": [ + "sdp", + "threadId" + ], + "properties": { + "sdp": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeStartedNotification": { + "description": "EXPERIMENTAL - emitted when thread realtime startup is accepted.", + "type": "object", + "required": [ + "threadId", + "version" + ], + "properties": { + "realtimeSessionId": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/RealtimeConversationVersion" + } + } + }, + "ThreadRealtimeTranscriptDeltaNotification": { + "description": "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", + "type": "object", + "required": [ + "delta", + "role", + "threadId" + ], + "properties": { + "delta": { + "description": "Live transcript delta from the realtime event.", + "type": "string" + }, + "role": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeTranscriptDoneNotification": { + "description": "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", + "type": "object", + "required": [ + "role", + "text", + "threadId" + ], + "properties": { + "role": { + "type": "string" + }, + "text": { + "description": "Final complete text for the transcript part.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStartedNotification": { + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + } + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "ThreadStatusChangedNotification": { + "type": "object", + "required": [ + "status", + "threadId" + ], + "properties": { + "status": { + "$ref": "#/definitions/ThreadStatus" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadTokenUsage": { + "type": "object", + "required": [ + "last", + "total" + ], + "properties": { + "last": { + "$ref": "#/definitions/TokenUsageBreakdown" + }, + "modelContextWindow": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "total": { + "$ref": "#/definitions/TokenUsageBreakdown" + } + } + }, + "ThreadTokenUsageUpdatedNotification": { + "type": "object", + "required": [ + "threadId", + "tokenUsage", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "tokenUsage": { + "$ref": "#/definitions/ThreadTokenUsage" + }, + "turnId": { + "type": "string" + } + } + }, + "ThreadUnarchivedNotification": { + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "TokenUsageBreakdown": { + "type": "object", + "required": [ + "cachedInputTokens", + "inputTokens", + "outputTokens", + "reasoningOutputTokens", + "totalTokens" + ], + "properties": { + "cachedInputTokens": { + "type": "integer", + "format": "int64" + }, + "inputTokens": { + "type": "integer", + "format": "int64" + }, + "outputTokens": { + "type": "integer", + "format": "int64" + }, + "reasoningOutputTokens": { + "type": "integer", + "format": "int64" + }, + "totalTokens": { + "type": "integer", + "format": "int64" + } + } + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnCompletedNotification": { + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "TurnDiffUpdatedNotification": { + "description": "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", + "type": "object", + "required": [ + "diff", + "threadId", + "turnId" + ], + "properties": { + "diff": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnPlanStep": { + "type": "object", + "required": [ + "status", + "step" + ], + "properties": { + "status": { + "$ref": "#/definitions/TurnPlanStepStatus" + }, + "step": { + "type": "string" + } + } + }, + "TurnPlanStepStatus": { + "type": "string", + "enum": [ + "pending", + "inProgress", + "completed" + ] + }, + "TurnPlanUpdatedNotification": { + "type": "object", + "required": [ + "plan", + "threadId", + "turnId" + ], + "properties": { + "explanation": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": "array", + "items": { + "$ref": "#/definitions/TurnPlanStep" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnStartedNotification": { + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WarningNotification": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "Concise warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Optional thread target when the warning applies to a specific thread.", + "type": [ + "string", + "null" + ] + } + } + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + }, + "WindowsSandboxSetupCompletedNotification": { + "type": "object", + "required": [ + "mode", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + }, + "success": { + "type": "boolean" + } + } + }, + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + }, + "WindowsWorldWritableWarningNotification": { + "type": "object", + "required": [ + "extraCount", + "failedScan", + "samplePaths" + ], + "properties": { + "extraCount": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "failedScan": { + "type": "boolean" + }, + "samplePaths": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/schemas/ServerRequest.json b/schemas/ServerRequest.json new file mode 100644 index 0000000..5655d27 --- /dev/null +++ b/schemas/ServerRequest.json @@ -0,0 +1,2001 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerRequest", + "description": "Request initiated from the server and sent to the client.", + "oneOf": [ + { + "description": "NEW APIs Sent when approval is requested for a specific command execution. This request is used for Turns started via turn/start.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/commandExecution/requestApproval" + ], + "title": "Item/commandExecution/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecutionRequestApprovalParams" + } + }, + "title": "Item/commandExecution/requestApprovalRequest" + }, + { + "description": "Sent when approval is requested for a specific file change. This request is used for Turns started via turn/start.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/fileChange/requestApproval" + ], + "title": "Item/fileChange/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/FileChangeRequestApprovalParams" + } + }, + "title": "Item/fileChange/requestApprovalRequest" + }, + { + "description": "EXPERIMENTAL - Request input from the user for a tool call.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/tool/requestUserInput" + ], + "title": "Item/tool/requestUserInputRequestMethod" + }, + "params": { + "$ref": "#/definitions/ToolRequestUserInputParams" + } + }, + "title": "Item/tool/requestUserInputRequest" + }, + { + "description": "Request input for an MCP server elicitation.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/elicitation/request" + ], + "title": "McpServer/elicitation/requestRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerElicitationRequestParams" + } + }, + "title": "McpServer/elicitation/requestRequest" + }, + { + "description": "Request approval for additional permissions from the user.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/permissions/requestApproval" + ], + "title": "Item/permissions/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/PermissionsRequestApprovalParams" + } + }, + "title": "Item/permissions/requestApprovalRequest" + }, + { + "description": "Execute a dynamic tool call on the client.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/tool/call" + ], + "title": "Item/tool/callRequestMethod" + }, + "params": { + "$ref": "#/definitions/DynamicToolCallParams" + } + }, + "title": "Item/tool/callRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/chatgptAuthTokens/refresh" + ], + "title": "Account/chatgptAuthTokens/refreshRequestMethod" + }, + "params": { + "$ref": "#/definitions/ChatgptAuthTokensRefreshParams" + } + }, + "title": "Account/chatgptAuthTokens/refreshRequest" + }, + { + "description": "Generate a fresh upstream attestation result on demand.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "attestation/generate" + ], + "title": "Attestation/generateRequestMethod" + }, + "params": { + "$ref": "#/definitions/AttestationGenerateParams" + } + }, + "title": "Attestation/generateRequest" + }, + { + "description": "DEPRECATED APIs below Request to approve a patch. This request is used for Turns started via the legacy APIs (i.e. SendUserTurn, SendUserMessage).", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "applyPatchApproval" + ], + "title": "ApplyPatchApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/ApplyPatchApprovalParams" + } + }, + "title": "ApplyPatchApprovalRequest" + }, + { + "description": "Request to exec a command. This request is used for Turns started via the legacy APIs (i.e. SendUserTurn, SendUserMessage).", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "execCommandApproval" + ], + "title": "ExecCommandApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExecCommandApprovalParams" + } + }, + "title": "ExecCommandApprovalRequest" + } + ], + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AdditionalPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "description": "Partial overlay used for per-command permission requests.", + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "ApplyPatchApprovalParams": { + "type": "object", + "required": [ + "callId", + "conversationId", + "fileChanges" + ], + "properties": { + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] and [codex_protocol::protocol::PatchApplyEndEvent].", + "type": "string" + }, + "conversationId": { + "$ref": "#/definitions/ThreadId" + }, + "fileChanges": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "grantRoot": { + "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + } + } + }, + "AttestationGenerateParams": { + "type": "object" + }, + "ChatgptAuthTokensRefreshParams": { + "type": "object", + "required": [ + "reason" + ], + "properties": { + "previousAccountId": { + "description": "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior auth state did not include a workspace identifier (`chatgpt_account_id`).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "$ref": "#/definitions/ChatgptAuthTokensRefreshReason" + } + } + }, + "ChatgptAuthTokensRefreshReason": { + "oneOf": [ + { + "description": "Codex attempted a backend request and received `401 Unauthorized`.", + "type": "string", + "enum": [ + "unauthorized" + ] + } + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionApprovalDecision": { + "oneOf": [ + { + "description": "User approved the command.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", + "type": "object", + "required": [ + "acceptWithExecpolicyAmendment" + ], + "properties": { + "acceptWithExecpolicyAmendment": { + "type": "object", + "required": [ + "execpolicy_amendment" + ], + "properties": { + "execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User chose a persistent network policy rule (allow/deny) for this host.", + "type": "object", + "required": [ + "applyNetworkPolicyAmendment" + ], + "properties": { + "applyNetworkPolicyAmendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User denied the command. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the command. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + }, + "CommandExecutionRequestApprovalParams": { + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + }, + "approvalId": { + "description": "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "type": [ + "string", + "null" + ] + }, + "commandActions": { + "description": "Best-effort parsed command actions for friendly display.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "itemId": { + "type": "string" + }, + "networkApprovalContext": { + "description": "Optional context for a managed-network approval prompt.", + "anyOf": [ + { + "$ref": "#/definitions/NetworkApprovalContext" + }, + { + "type": "null" + } + ] + }, + "proposedExecpolicyAmendment": { + "description": "Optional proposed execpolicy amendment to allow similar commands without prompting.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "proposedNetworkPolicyAmendments": { + "description": "Optional proposed network policy amendments (allow/deny host) for future requests.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for network access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + } + } + }, + "DynamicToolCallParams": { + "type": "object", + "required": [ + "arguments", + "callId", + "threadId", + "tool", + "turnId" + ], + "properties": { + "arguments": true, + "callId": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ExecCommandApprovalParams": { + "type": "object", + "required": [ + "callId", + "command", + "conversationId", + "cwd", + "parsedCmd" + ], + "properties": { + "approvalId": { + "description": "Identifier for this specific approval callback.", + "type": [ + "string", + "null" + ] + }, + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] and [codex_protocol::protocol::ExecCommandEndEvent].", + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "conversationId": { + "$ref": "#/definitions/ThreadId" + }, + "cwd": { + "type": "string" + }, + "parsedCmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "reason": { + "type": [ + "string", + "null" + ] + } + } + }, + "FileChange": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddFileChangeType" + } + }, + "title": "AddFileChange" + }, + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeleteFileChangeType" + } + }, + "title": "DeleteFileChange" + }, + { + "type": "object", + "required": [ + "type", + "unified_diff" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdateFileChangeType" + }, + "unified_diff": { + "type": "string" + } + }, + "title": "UpdateFileChange" + } + ] + }, + "FileChangeRequestApprovalParams": { + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "grantRoot": { + "description": "[UNSTABLE] When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "itemId": { + "type": "string" + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "McpElicitationArrayType": { + "type": "string", + "enum": [ + "array" + ] + }, + "McpElicitationBooleanSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "boolean", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationBooleanType" + } + }, + "additionalProperties": false + }, + "McpElicitationBooleanType": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "McpElicitationConstOption": { + "type": "object", + "required": [ + "const", + "title" + ], + "properties": { + "const": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "McpElicitationEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationLegacyTitledEnumSchema" + } + ] + }, + "McpElicitationLegacyTitledEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "enumNames": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationMultiSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledMultiSelectEnumSchema" + } + ] + }, + "McpElicitationNumberSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "maximum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "minimum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationNumberType" + } + }, + "additionalProperties": false + }, + "McpElicitationNumberType": { + "type": "string", + "enum": [ + "number", + "integer" + ] + }, + "McpElicitationObjectType": { + "type": "string", + "enum": [ + "object" + ] + }, + "McpElicitationPrimitiveSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationStringSchema" + }, + { + "$ref": "#/definitions/McpElicitationNumberSchema" + }, + { + "$ref": "#/definitions/McpElicitationBooleanSchema" + } + ] + }, + "McpElicitationSchema": { + "description": "Typed form schema for MCP `elicitation/create` requests.\n\nThis matches the `requestedSchema` shape from the MCP 2025-11-25 `ElicitRequestFormParams` schema.", + "type": "object", + "required": [ + "properties", + "type" + ], + "properties": { + "$schema": { + "type": [ + "string", + "null" + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/McpElicitationPrimitiveSchema" + } + }, + "required": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationObjectType" + } + }, + "additionalProperties": false + }, + "McpElicitationSingleSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledSingleSelectEnumSchema" + } + ] + }, + "McpElicitationStringFormat": { + "type": "string", + "enum": [ + "email", + "uri", + "date", + "date-time" + ] + }, + "McpElicitationStringSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "format": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationStringFormat" + }, + { + "type": "null" + } + ] + }, + "maxLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "minLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationStringType": { + "type": "string", + "enum": [ + "string" + ] + }, + "McpElicitationTitledEnumItems": { + "type": "object", + "required": [ + "anyOf" + ], + "properties": { + "anyOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + } + }, + "additionalProperties": false + }, + "McpElicitationTitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationTitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationTitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "oneOf", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledEnumItems": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationUntitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpServerElicitationRequestParams": { + "type": "object", + "oneOf": [ + { + "type": "object", + "required": [ + "message", + "mode", + "requestedSchema" + ], + "properties": { + "_meta": true, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "form" + ] + }, + "requestedSchema": { + "$ref": "#/definitions/McpElicitationSchema" + } + } + }, + { + "type": "object", + "required": [ + "elicitationId", + "message", + "mode", + "url" + ], + "properties": { + "_meta": true, + "elicitationId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "url" + ] + }, + "url": { + "type": "string" + } + } + } + ], + "required": [ + "serverName", + "threadId" + ], + "properties": { + "serverName": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "description": "Active Codex turn when this elicitation was observed, if app-server could correlate one.\n\nThis is nullable because MCP models elicitation as a standalone server-to-client request identified by the MCP server request id. It may be triggered during a turn, but turn context is app-server correlation rather than part of the protocol identity of the elicitation itself.", + "type": [ + "string", + "null" + ] + } + } + }, + "NetworkApprovalContext": { + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "host": { + "type": "string" + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + } + } + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "ParsedCommand": { + "oneOf": [ + { + "type": "object", + "required": [ + "cmd", + "name", + "path", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "description": "(Best effort) Path to the file being read by the command. When possible, this is an absolute path, though when relative, it should be resolved against the `cwd`` that will be used to run the command to derive the absolute path.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadParsedCommandType" + } + }, + "title": "ReadParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "list_files" + ], + "title": "ListFilesParsedCommandType" + } + }, + "title": "ListFilesParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchParsedCommandType" + } + }, + "title": "SearchParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownParsedCommandType" + } + }, + "title": "UnknownParsedCommand" + } + ] + }, + "PermissionsRequestApprovalParams": { + "type": "object", + "required": [ + "cwd", + "itemId", + "permissions", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "itemId": { + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ThreadId": { + "type": "string" + }, + "ToolRequestUserInputOption": { + "description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.", + "type": "object", + "required": [ + "description", + "label" + ], + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "ToolRequestUserInputParams": { + "description": "EXPERIMENTAL. Params sent with a request_user_input event.", + "type": "object", + "required": [ + "itemId", + "questions", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolRequestUserInputQuestion" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ToolRequestUserInputQuestion": { + "description": "EXPERIMENTAL. Represents one request_user_input question and its required options.", + "type": "object", + "required": [ + "header", + "id", + "question" + ], + "properties": { + "header": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isOther": { + "default": false, + "type": "boolean" + }, + "isSecret": { + "default": false, + "type": "boolean" + }, + "options": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ToolRequestUserInputOption" + } + }, + "question": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/ToolRequestUserInputParams.json b/schemas/ToolRequestUserInputParams.json new file mode 100644 index 0000000..75b985d --- /dev/null +++ b/schemas/ToolRequestUserInputParams.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ToolRequestUserInputParams", + "description": "EXPERIMENTAL. Params sent with a request_user_input event.", + "type": "object", + "required": [ + "itemId", + "questions", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolRequestUserInputQuestion" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "ToolRequestUserInputOption": { + "description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.", + "type": "object", + "required": [ + "description", + "label" + ], + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "ToolRequestUserInputQuestion": { + "description": "EXPERIMENTAL. Represents one request_user_input question and its required options.", + "type": "object", + "required": [ + "header", + "id", + "question" + ], + "properties": { + "header": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isOther": { + "default": false, + "type": "boolean" + }, + "isSecret": { + "default": false, + "type": "boolean" + }, + "options": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ToolRequestUserInputOption" + } + }, + "question": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/ToolRequestUserInputResponse.json b/schemas/ToolRequestUserInputResponse.json new file mode 100644 index 0000000..73d87dd --- /dev/null +++ b/schemas/ToolRequestUserInputResponse.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ToolRequestUserInputResponse", + "description": "EXPERIMENTAL. Response payload mapping question ids to answers.", + "type": "object", + "required": [ + "answers" + ], + "properties": { + "answers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ToolRequestUserInputAnswer" + } + } + }, + "definitions": { + "ToolRequestUserInputAnswer": { + "description": "EXPERIMENTAL. Captures a user's answer to a request_user_input question.", + "type": "object", + "required": [ + "answers" + ], + "properties": { + "answers": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/schemas/codex_app_server_protocol.schemas.json b/schemas/codex_app_server_protocol.schemas.json new file mode 100644 index 0000000..ebfd9ce --- /dev/null +++ b/schemas/codex_app_server_protocol.schemas.json @@ -0,0 +1,18535 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CodexAppServerProtocol", + "type": "object", + "definitions": { + "RequestId": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RequestId", + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "JSONRPCError": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCError", + "description": "A response to a request that indicates an error occurred.", + "type": "object", + "required": [ + "error", + "id" + ], + "properties": { + "error": { + "$ref": "#/definitions/JSONRPCErrorError" + }, + "id": { + "$ref": "#/definitions/v2/RequestId" + } + } + }, + "JSONRPCErrorError": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCErrorError", + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "integer", + "format": "int64" + }, + "data": true, + "message": { + "type": "string" + } + } + }, + "JSONRPCNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCNotification", + "description": "A notification which does not expect a response.", + "type": "object", + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string" + }, + "params": true + } + }, + "JSONRPCRequest": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCRequest", + "description": "A request that expects a response.", + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string" + }, + "params": true, + "trace": { + "description": "Optional W3C Trace Context for distributed tracing.", + "anyOf": [ + { + "$ref": "#/definitions/W3cTraceContext" + }, + { + "type": "null" + } + ] + } + } + }, + "JSONRPCResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCResponse", + "description": "A successful (non-error) response to a request.", + "type": "object", + "required": [ + "id", + "result" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "result": true + } + }, + "W3cTraceContext": { + "type": "object", + "properties": { + "traceparent": { + "type": [ + "string", + "null" + ] + }, + "tracestate": { + "type": [ + "string", + "null" + ] + } + } + }, + "JSONRPCMessage": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "JSONRPCMessage", + "description": "Refers to any valid JSON-RPC object that can be decoded off the wire, or encoded to be sent.", + "anyOf": [ + { + "$ref": "#/definitions/JSONRPCRequest" + }, + { + "$ref": "#/definitions/JSONRPCNotification" + }, + { + "$ref": "#/definitions/JSONRPCResponse" + }, + { + "$ref": "#/definitions/JSONRPCError" + } + ] + }, + "ClientInfo": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string" + } + } + }, + "FuzzyFileSearchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchParams", + "type": "object", + "required": [ + "query", + "roots" + ], + "properties": { + "cancellationToken": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": "string" + }, + "roots": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ExecCommandApprovalResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecCommandApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/ReviewDecision" + } + } + }, + "ApplyPatchApprovalResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApplyPatchApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/ReviewDecision" + } + } + }, + "ReviewDecision": { + "description": "User's decision in response to an ExecApprovalRequest.", + "oneOf": [ + { + "description": "User has approved this command and the agent should execute it.", + "type": "string", + "enum": [ + "approved" + ] + }, + { + "description": "User has approved this command and wants to apply the proposed execpolicy amendment so future matching commands are permitted.", + "type": "object", + "required": [ + "approved_execpolicy_amendment" + ], + "properties": { + "approved_execpolicy_amendment": { + "type": "object", + "required": [ + "proposed_execpolicy_amendment" + ], + "properties": { + "proposed_execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "ApprovedExecpolicyAmendmentReviewDecision" + }, + { + "description": "User has approved this request and wants future prompts in the same session-scoped approval cache to be automatically approved for the remainder of the session.", + "type": "string", + "enum": [ + "approved_for_session" + ] + }, + { + "description": "User chose to persist a network policy rule (allow/deny) for future requests to the same host.", + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "NetworkPolicyAmendmentReviewDecision" + }, + { + "description": "User has denied this command and the agent should not execute it, but it should continue the session and try something else.", + "type": "string", + "enum": [ + "denied" + ] + }, + { + "description": "Automatic approval review timed out before reaching a decision.", + "type": "string", + "enum": [ + "timed_out" + ] + }, + { + "description": "User has denied this command and the agent should not do anything until the user's next command.", + "type": "string", + "enum": [ + "abort" + ] + } + ] + }, + "InitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", + "type": "object", + "properties": { + "experimentalApi": { + "description": "Opt into receiving experimental API methods and fields.", + "default": false, + "type": "boolean" + }, + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requestAttestation": { + "description": "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + "default": false, + "type": "boolean" + } + } + }, + "InitializeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InitializeParams", + "type": "object", + "required": [ + "clientInfo" + ], + "properties": { + "capabilities": { + "anyOf": [ + { + "$ref": "#/definitions/InitializeCapabilities" + }, + { + "type": "null" + } + ] + }, + "clientInfo": { + "$ref": "#/definitions/ClientInfo" + } + } + }, + "ClientRequest": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClientRequest", + "description": "Request from the client to the server.", + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "initialize" + ], + "title": "InitializeRequestMethod" + }, + "params": { + "$ref": "#/definitions/InitializeParams" + } + }, + "title": "InitializeRequest" + }, + { + "description": "NEW APIs", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/start" + ], + "title": "Thread/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadStartParams" + } + }, + "title": "Thread/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/resume" + ], + "title": "Thread/resumeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadResumeParams" + } + }, + "title": "Thread/resumeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/fork" + ], + "title": "Thread/forkRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadForkParams" + } + }, + "title": "Thread/forkRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/archive" + ], + "title": "Thread/archiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadArchiveParams" + } + }, + "title": "Thread/archiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unsubscribe" + ], + "title": "Thread/unsubscribeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadUnsubscribeParams" + } + }, + "title": "Thread/unsubscribeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/name/set" + ], + "title": "Thread/name/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadSetNameParams" + } + }, + "title": "Thread/name/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/metadata/update" + ], + "title": "Thread/metadata/updateRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadMetadataUpdateParams" + } + }, + "title": "Thread/metadata/updateRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unarchive" + ], + "title": "Thread/unarchiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadUnarchiveParams" + } + }, + "title": "Thread/unarchiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/compact/start" + ], + "title": "Thread/compact/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadCompactStartParams" + } + }, + "title": "Thread/compact/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/shellCommand" + ], + "title": "Thread/shellCommandRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadShellCommandParams" + } + }, + "title": "Thread/shellCommandRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/approveGuardianDeniedAction" + ], + "title": "Thread/approveGuardianDeniedActionRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadApproveGuardianDeniedActionParams" + } + }, + "title": "Thread/approveGuardianDeniedActionRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/rollback" + ], + "title": "Thread/rollbackRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRollbackParams" + } + }, + "title": "Thread/rollbackRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/list" + ], + "title": "Thread/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadListParams" + } + }, + "title": "Thread/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/loaded/list" + ], + "title": "Thread/loaded/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadLoadedListParams" + } + }, + "title": "Thread/loaded/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/read" + ], + "title": "Thread/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadReadParams" + } + }, + "title": "Thread/readRequest" + }, + { + "description": "Append raw Responses API items to the thread history without starting a user turn.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/inject_items" + ], + "title": "Thread/injectItemsRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadInjectItemsParams" + } + }, + "title": "Thread/injectItemsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/list" + ], + "title": "Skills/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/SkillsListParams" + } + }, + "title": "Skills/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "hooks/list" + ], + "title": "Hooks/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/HooksListParams" + } + }, + "title": "Hooks/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/add" + ], + "title": "Marketplace/addRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/MarketplaceAddParams" + } + }, + "title": "Marketplace/addRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/remove" + ], + "title": "Marketplace/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/MarketplaceRemoveParams" + } + }, + "title": "Marketplace/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/upgrade" + ], + "title": "Marketplace/upgradeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/MarketplaceUpgradeParams" + } + }, + "title": "Marketplace/upgradeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/list" + ], + "title": "Plugin/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginListParams" + } + }, + "title": "Plugin/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/installed" + ], + "title": "Plugin/installedRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginInstalledParams" + } + }, + "title": "Plugin/installedRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/read" + ], + "title": "Plugin/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginReadParams" + } + }, + "title": "Plugin/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/skill/read" + ], + "title": "Plugin/skill/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginSkillReadParams" + } + }, + "title": "Plugin/skill/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/save" + ], + "title": "Plugin/share/saveRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginShareSaveParams" + } + }, + "title": "Plugin/share/saveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/updateTargets" + ], + "title": "Plugin/share/updateTargetsRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginShareUpdateTargetsParams" + } + }, + "title": "Plugin/share/updateTargetsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/list" + ], + "title": "Plugin/share/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginShareListParams" + } + }, + "title": "Plugin/share/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/checkout" + ], + "title": "Plugin/share/checkoutRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginShareCheckoutParams" + } + }, + "title": "Plugin/share/checkoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/delete" + ], + "title": "Plugin/share/deleteRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginShareDeleteParams" + } + }, + "title": "Plugin/share/deleteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "app/list" + ], + "title": "App/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/AppsListParams" + } + }, + "title": "App/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readFile" + ], + "title": "Fs/readFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsReadFileParams" + } + }, + "title": "Fs/readFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/writeFile" + ], + "title": "Fs/writeFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsWriteFileParams" + } + }, + "title": "Fs/writeFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/createDirectory" + ], + "title": "Fs/createDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsCreateDirectoryParams" + } + }, + "title": "Fs/createDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/getMetadata" + ], + "title": "Fs/getMetadataRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsGetMetadataParams" + } + }, + "title": "Fs/getMetadataRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readDirectory" + ], + "title": "Fs/readDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsReadDirectoryParams" + } + }, + "title": "Fs/readDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/remove" + ], + "title": "Fs/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsRemoveParams" + } + }, + "title": "Fs/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/copy" + ], + "title": "Fs/copyRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsCopyParams" + } + }, + "title": "Fs/copyRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/watch" + ], + "title": "Fs/watchRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsWatchParams" + } + }, + "title": "Fs/watchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/unwatch" + ], + "title": "Fs/unwatchRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsUnwatchParams" + } + }, + "title": "Fs/unwatchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/config/write" + ], + "title": "Skills/config/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/SkillsConfigWriteParams" + } + }, + "title": "Skills/config/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/install" + ], + "title": "Plugin/installRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginInstallParams" + } + }, + "title": "Plugin/installRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/uninstall" + ], + "title": "Plugin/uninstallRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/PluginUninstallParams" + } + }, + "title": "Plugin/uninstallRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/start" + ], + "title": "Turn/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnStartParams" + } + }, + "title": "Turn/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/steer" + ], + "title": "Turn/steerRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnSteerParams" + } + }, + "title": "Turn/steerRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/interrupt" + ], + "title": "Turn/interruptRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnInterruptParams" + } + }, + "title": "Turn/interruptRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "review/start" + ], + "title": "Review/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ReviewStartParams" + } + }, + "title": "Review/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "model/list" + ], + "title": "Model/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ModelListParams" + } + }, + "title": "Model/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "modelProvider/capabilities/read" + ], + "title": "ModelProvider/capabilities/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ModelProviderCapabilitiesReadParams" + } + }, + "title": "ModelProvider/capabilities/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/list" + ], + "title": "ExperimentalFeature/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ExperimentalFeatureListParams" + } + }, + "title": "ExperimentalFeature/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/enablement/set" + ], + "title": "ExperimentalFeature/enablement/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ExperimentalFeatureEnablementSetParams" + } + }, + "title": "ExperimentalFeature/enablement/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/oauth/login" + ], + "title": "McpServer/oauth/loginRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpServerOauthLoginParams" + } + }, + "title": "McpServer/oauth/loginRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/mcpServer/reload" + ], + "title": "Config/mcpServer/reloadRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Config/mcpServer/reloadRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServerStatus/list" + ], + "title": "McpServerStatus/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ListMcpServerStatusParams" + } + }, + "title": "McpServerStatus/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/resource/read" + ], + "title": "McpServer/resource/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpResourceReadParams" + } + }, + "title": "McpServer/resource/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpServerToolCallParams" + } + }, + "title": "McpServer/tool/callRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupStart" + ], + "title": "WindowsSandbox/setupStartRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/WindowsSandboxSetupStartParams" + } + }, + "title": "WindowsSandbox/setupStartRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/readiness" + ], + "title": "WindowsSandbox/readinessRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "WindowsSandbox/readinessRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/start" + ], + "title": "Account/login/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/LoginAccountParams" + } + }, + "title": "Account/login/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/cancel" + ], + "title": "Account/login/cancelRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/CancelLoginAccountParams" + } + }, + "title": "Account/login/cancelRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/logout" + ], + "title": "Account/logoutRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/logoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/rateLimits/read" + ], + "title": "Account/rateLimits/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/rateLimits/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/sendAddCreditsNudgeEmail" + ], + "title": "Account/sendAddCreditsNudgeEmailRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/SendAddCreditsNudgeEmailParams" + } + }, + "title": "Account/sendAddCreditsNudgeEmailRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "feedback/upload" + ], + "title": "Feedback/uploadRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/FeedbackUploadParams" + } + }, + "title": "Feedback/uploadRequest" + }, + { + "description": "Execute a standalone command (argv vector) under the server's sandbox.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec" + ], + "title": "Command/execRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecParams" + } + }, + "title": "Command/execRequest" + }, + { + "description": "Write stdin bytes to a running `command/exec` session or close stdin.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/write" + ], + "title": "Command/exec/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecWriteParams" + } + }, + "title": "Command/exec/writeRequest" + }, + { + "description": "Terminate a running `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/terminate" + ], + "title": "Command/exec/terminateRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecTerminateParams" + } + }, + "title": "Command/exec/terminateRequest" + }, + { + "description": "Resize a running PTY-backed `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/resize" + ], + "title": "Command/exec/resizeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecResizeParams" + } + }, + "title": "Command/exec/resizeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/read" + ], + "title": "Config/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ConfigReadParams" + } + }, + "title": "Config/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/detect" + ], + "title": "ExternalAgentConfig/detectRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ExternalAgentConfigDetectParams" + } + }, + "title": "ExternalAgentConfig/detectRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import" + ], + "title": "ExternalAgentConfig/importRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ExternalAgentConfigImportParams" + } + }, + "title": "ExternalAgentConfig/importRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/value/write" + ], + "title": "Config/value/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ConfigValueWriteParams" + } + }, + "title": "Config/value/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/batchWrite" + ], + "title": "Config/batchWriteRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/ConfigBatchWriteParams" + } + }, + "title": "Config/batchWriteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "configRequirements/read" + ], + "title": "ConfigRequirements/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "ConfigRequirements/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/read" + ], + "title": "Account/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/v2/GetAccountParams" + } + }, + "title": "Account/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch" + ], + "title": "FuzzyFileSearchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchParams" + } + }, + "title": "FuzzyFileSearchRequest" + } + ] + }, + "AdditionalPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "description": "Partial overlay used for per-command permission requests.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "ApplyPatchApprovalParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ApplyPatchApprovalParams", + "type": "object", + "required": [ + "callId", + "conversationId", + "fileChanges" + ], + "properties": { + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::PatchApplyBeginEvent] and [codex_protocol::protocol::PatchApplyEndEvent].", + "type": "string" + }, + "conversationId": { + "$ref": "#/definitions/v2/ThreadId" + }, + "fileChanges": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/FileChange" + } + }, + "grantRoot": { + "description": "When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + } + } + }, + "AttestationGenerateParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AttestationGenerateParams", + "type": "object" + }, + "ChatgptAuthTokensRefreshParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChatgptAuthTokensRefreshParams", + "type": "object", + "required": [ + "reason" + ], + "properties": { + "previousAccountId": { + "description": "Workspace/account identifier that Codex was previously using.\n\nClients that manage multiple accounts/workspaces can use this as a hint to refresh the token for the correct workspace.\n\nThis may be `null` when the prior auth state did not include a workspace identifier (`chatgpt_account_id`).", + "type": [ + "string", + "null" + ] + }, + "reason": { + "$ref": "#/definitions/ChatgptAuthTokensRefreshReason" + } + } + }, + "ChatgptAuthTokensRefreshReason": { + "oneOf": [ + { + "description": "Codex attempted a backend request and received `401 Unauthorized`.", + "type": "string", + "enum": [ + "unauthorized" + ] + } + ] + }, + "CommandExecutionApprovalDecision": { + "oneOf": [ + { + "description": "User approved the command.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the command and future prompts in the same session-scoped approval cache should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User approved the command, and wants to apply the proposed execpolicy amendment so future matching commands can run without prompting.", + "type": "object", + "required": [ + "acceptWithExecpolicyAmendment" + ], + "properties": { + "acceptWithExecpolicyAmendment": { + "type": "object", + "required": [ + "execpolicy_amendment" + ], + "properties": { + "execpolicy_amendment": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "title": "AcceptWithExecpolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User chose a persistent network policy rule (allow/deny) for this host.", + "type": "object", + "required": [ + "applyNetworkPolicyAmendment" + ], + "properties": { + "applyNetworkPolicyAmendment": { + "type": "object", + "required": [ + "network_policy_amendment" + ], + "properties": { + "network_policy_amendment": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + } + } + }, + "additionalProperties": false, + "title": "ApplyNetworkPolicyAmendmentCommandExecutionApprovalDecision" + }, + { + "description": "User denied the command. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the command. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + }, + "CommandExecutionRequestApprovalParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionRequestApprovalParams", + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + }, + "approvalId": { + "description": "Unique identifier for this specific approval callback.\n\nFor regular shell/unified_exec approvals, this is null.\n\nFor zsh-exec-bridge subcommand approvals, multiple callbacks can belong to one parent `itemId`, so `approvalId` is a distinct opaque callback id (a UUID) used to disambiguate routing.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "command": { + "description": "The command to be executed.", + "type": [ + "string", + "null" + ] + }, + "commandActions": { + "description": "Best-effort parsed command actions for friendly display.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "itemId": { + "type": "string" + }, + "networkApprovalContext": { + "description": "Optional context for a managed-network approval prompt.", + "anyOf": [ + { + "$ref": "#/definitions/NetworkApprovalContext" + }, + { + "type": "null" + } + ] + }, + "proposedExecpolicyAmendment": { + "description": "Optional proposed execpolicy amendment to allow similar commands without prompting.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "proposedNetworkPolicyAmendments": { + "description": "Optional proposed network policy amendments (allow/deny host) for future requests.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/NetworkPolicyAmendment" + } + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for network access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + } + } + }, + "DynamicToolCallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DynamicToolCallParams", + "type": "object", + "required": [ + "arguments", + "callId", + "threadId", + "tool", + "turnId" + ], + "properties": { + "arguments": true, + "callId": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ExecCommandApprovalParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecCommandApprovalParams", + "type": "object", + "required": [ + "callId", + "command", + "conversationId", + "cwd", + "parsedCmd" + ], + "properties": { + "approvalId": { + "description": "Identifier for this specific approval callback.", + "type": [ + "string", + "null" + ] + }, + "callId": { + "description": "Use to correlate this with [codex_protocol::protocol::ExecCommandBeginEvent] and [codex_protocol::protocol::ExecCommandEndEvent].", + "type": "string" + }, + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "conversationId": { + "$ref": "#/definitions/v2/ThreadId" + }, + "cwd": { + "type": "string" + }, + "parsedCmd": { + "type": "array", + "items": { + "$ref": "#/definitions/ParsedCommand" + } + }, + "reason": { + "type": [ + "string", + "null" + ] + } + } + }, + "FileChange": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddFileChangeType" + } + }, + "title": "AddFileChange" + }, + { + "type": "object", + "required": [ + "content", + "type" + ], + "properties": { + "content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeleteFileChangeType" + } + }, + "title": "DeleteFileChange" + }, + { + "type": "object", + "required": [ + "type", + "unified_diff" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdateFileChangeType" + }, + "unified_diff": { + "type": "string" + } + }, + "title": "UpdateFileChange" + } + ] + }, + "FileChangeRequestApprovalParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeRequestApprovalParams", + "type": "object", + "required": [ + "itemId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "grantRoot": { + "description": "[UNSTABLE] When set, the agent is asking the user to allow writes under this root for the remainder of the session (unclear if this is honored today).", + "type": [ + "string", + "null" + ] + }, + "itemId": { + "type": "string" + }, + "reason": { + "description": "Optional explanatory reason (e.g. request for extra write access).", + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "McpElicitationArrayType": { + "type": "string", + "enum": [ + "array" + ] + }, + "McpElicitationBooleanSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "boolean", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationBooleanType" + } + }, + "additionalProperties": false + }, + "McpElicitationBooleanType": { + "type": "string", + "enum": [ + "boolean" + ] + }, + "McpElicitationConstOption": { + "type": "object", + "required": [ + "const", + "title" + ], + "properties": { + "const": { + "type": "string" + }, + "title": { + "type": "string" + } + }, + "additionalProperties": false + }, + "McpElicitationEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationLegacyTitledEnumSchema" + } + ] + }, + "McpElicitationLegacyTitledEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "enumNames": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationMultiSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledMultiSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledMultiSelectEnumSchema" + } + ] + }, + "McpElicitationNumberSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "maximum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "minimum": { + "type": [ + "number", + "null" + ], + "format": "double" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationNumberType" + } + }, + "additionalProperties": false + }, + "McpElicitationNumberType": { + "type": "string", + "enum": [ + "number", + "integer" + ] + }, + "McpElicitationObjectType": { + "type": "string", + "enum": [ + "object" + ] + }, + "McpElicitationPrimitiveSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationStringSchema" + }, + { + "$ref": "#/definitions/McpElicitationNumberSchema" + }, + { + "$ref": "#/definitions/McpElicitationBooleanSchema" + } + ] + }, + "McpElicitationSchema": { + "description": "Typed form schema for MCP `elicitation/create` requests.\n\nThis matches the `requestedSchema` shape from the MCP 2025-11-25 `ElicitRequestFormParams` schema.", + "type": "object", + "required": [ + "properties", + "type" + ], + "properties": { + "$schema": { + "type": [ + "string", + "null" + ] + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/McpElicitationPrimitiveSchema" + } + }, + "required": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationObjectType" + } + }, + "additionalProperties": false + }, + "McpElicitationSingleSelectEnumSchema": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationUntitledSingleSelectEnumSchema" + }, + { + "$ref": "#/definitions/McpElicitationTitledSingleSelectEnumSchema" + } + ] + }, + "McpElicitationStringFormat": { + "type": "string", + "enum": [ + "email", + "uri", + "date", + "date-time" + ] + }, + "McpElicitationStringSchema": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "format": { + "anyOf": [ + { + "$ref": "#/definitions/McpElicitationStringFormat" + }, + { + "type": "null" + } + ] + }, + "maxLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "minLength": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationStringType": { + "type": "string", + "enum": [ + "string" + ] + }, + "McpElicitationTitledEnumItems": { + "type": "object", + "required": [ + "anyOf" + ], + "properties": { + "anyOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + } + }, + "additionalProperties": false + }, + "McpElicitationTitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationTitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationTitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "oneOf", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "oneOf": { + "type": "array", + "items": { + "$ref": "#/definitions/McpElicitationConstOption" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledEnumItems": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledMultiSelectEnumSchema": { + "type": "object", + "required": [ + "items", + "type" + ], + "properties": { + "default": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "items": { + "$ref": "#/definitions/McpElicitationUntitledEnumItems" + }, + "maxItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "minItems": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationArrayType" + } + }, + "additionalProperties": false + }, + "McpElicitationUntitledSingleSelectEnumSchema": { + "type": "object", + "required": [ + "enum", + "type" + ], + "properties": { + "default": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "enum": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "type": { + "$ref": "#/definitions/McpElicitationStringType" + } + }, + "additionalProperties": false + }, + "McpServerElicitationRequestParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerElicitationRequestParams", + "type": "object", + "oneOf": [ + { + "type": "object", + "required": [ + "message", + "mode", + "requestedSchema" + ], + "properties": { + "_meta": true, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "form" + ] + }, + "requestedSchema": { + "$ref": "#/definitions/McpElicitationSchema" + } + } + }, + { + "type": "object", + "required": [ + "elicitationId", + "message", + "mode", + "url" + ], + "properties": { + "_meta": true, + "elicitationId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "mode": { + "type": "string", + "enum": [ + "url" + ] + }, + "url": { + "type": "string" + } + } + } + ], + "required": [ + "serverName", + "threadId" + ], + "properties": { + "serverName": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "description": "Active Codex turn when this elicitation was observed, if app-server could correlate one.\n\nThis is nullable because MCP models elicitation as a standalone server-to-client request identified by the MCP server request id. It may be triggered during a turn, but turn context is app-server correlation rather than part of the protocol identity of the elicitation itself.", + "type": [ + "string", + "null" + ] + } + } + }, + "NetworkApprovalContext": { + "type": "object", + "required": [ + "host", + "protocol" + ], + "properties": { + "host": { + "type": "string" + }, + "protocol": { + "$ref": "#/definitions/v2/NetworkApprovalProtocol" + } + } + }, + "NetworkPolicyAmendment": { + "type": "object", + "required": [ + "action", + "host" + ], + "properties": { + "action": { + "$ref": "#/definitions/NetworkPolicyRuleAction" + }, + "host": { + "type": "string" + } + } + }, + "NetworkPolicyRuleAction": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "ParsedCommand": { + "oneOf": [ + { + "type": "object", + "required": [ + "cmd", + "name", + "path", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "description": "(Best effort) Path to the file being read by the command. When possible, this is an absolute path, though when relative, it should be resolved against the `cwd`` that will be used to run the command to derive the absolute path.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadParsedCommandType" + } + }, + "title": "ReadParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "list_files" + ], + "title": "ListFilesParsedCommandType" + } + }, + "title": "ListFilesParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchParsedCommandType" + } + }, + "title": "SearchParsedCommand" + }, + { + "type": "object", + "required": [ + "cmd", + "type" + ], + "properties": { + "cmd": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownParsedCommandType" + } + }, + "title": "UnknownParsedCommand" + } + ] + }, + "PermissionsRequestApprovalParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionsRequestApprovalParams", + "type": "object", + "required": [ + "cwd", + "itemId", + "permissions", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "itemId": { + "type": "string" + }, + "permissions": { + "$ref": "#/definitions/v2/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this approval request started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ToolRequestUserInputOption": { + "description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.", + "type": "object", + "required": [ + "description", + "label" + ], + "properties": { + "description": { + "type": "string" + }, + "label": { + "type": "string" + } + } + }, + "ToolRequestUserInputParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ToolRequestUserInputParams", + "description": "EXPERIMENTAL. Params sent with a request_user_input event.", + "type": "object", + "required": [ + "itemId", + "questions", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolRequestUserInputQuestion" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ToolRequestUserInputQuestion": { + "description": "EXPERIMENTAL. Represents one request_user_input question and its required options.", + "type": "object", + "required": [ + "header", + "id", + "question" + ], + "properties": { + "header": { + "type": "string" + }, + "id": { + "type": "string" + }, + "isOther": { + "default": false, + "type": "boolean" + }, + "isSecret": { + "default": false, + "type": "boolean" + }, + "options": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ToolRequestUserInputOption" + } + }, + "question": { + "type": "string" + } + } + }, + "ServerRequest": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerRequest", + "description": "Request initiated from the server and sent to the client.", + "oneOf": [ + { + "description": "NEW APIs Sent when approval is requested for a specific command execution. This request is used for Turns started via turn/start.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/commandExecution/requestApproval" + ], + "title": "Item/commandExecution/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecutionRequestApprovalParams" + } + }, + "title": "Item/commandExecution/requestApprovalRequest" + }, + { + "description": "Sent when approval is requested for a specific file change. This request is used for Turns started via turn/start.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/fileChange/requestApproval" + ], + "title": "Item/fileChange/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/FileChangeRequestApprovalParams" + } + }, + "title": "Item/fileChange/requestApprovalRequest" + }, + { + "description": "EXPERIMENTAL - Request input from the user for a tool call.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/tool/requestUserInput" + ], + "title": "Item/tool/requestUserInputRequestMethod" + }, + "params": { + "$ref": "#/definitions/ToolRequestUserInputParams" + } + }, + "title": "Item/tool/requestUserInputRequest" + }, + { + "description": "Request input for an MCP server elicitation.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/elicitation/request" + ], + "title": "McpServer/elicitation/requestRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerElicitationRequestParams" + } + }, + "title": "McpServer/elicitation/requestRequest" + }, + { + "description": "Request approval for additional permissions from the user.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/permissions/requestApproval" + ], + "title": "Item/permissions/requestApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/PermissionsRequestApprovalParams" + } + }, + "title": "Item/permissions/requestApprovalRequest" + }, + { + "description": "Execute a dynamic tool call on the client.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "item/tool/call" + ], + "title": "Item/tool/callRequestMethod" + }, + "params": { + "$ref": "#/definitions/DynamicToolCallParams" + } + }, + "title": "Item/tool/callRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/chatgptAuthTokens/refresh" + ], + "title": "Account/chatgptAuthTokens/refreshRequestMethod" + }, + "params": { + "$ref": "#/definitions/ChatgptAuthTokensRefreshParams" + } + }, + "title": "Account/chatgptAuthTokens/refreshRequest" + }, + { + "description": "Generate a fresh upstream attestation result on demand.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "attestation/generate" + ], + "title": "Attestation/generateRequestMethod" + }, + "params": { + "$ref": "#/definitions/AttestationGenerateParams" + } + }, + "title": "Attestation/generateRequest" + }, + { + "description": "DEPRECATED APIs below Request to approve a patch. This request is used for Turns started via the legacy APIs (i.e. SendUserTurn, SendUserMessage).", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "applyPatchApproval" + ], + "title": "ApplyPatchApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/ApplyPatchApprovalParams" + } + }, + "title": "ApplyPatchApprovalRequest" + }, + { + "description": "Request to exec a command. This request is used for Turns started via the legacy APIs (i.e. SendUserTurn, SendUserMessage).", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/v2/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "execCommandApproval" + ], + "title": "ExecCommandApprovalRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExecCommandApprovalParams" + } + }, + "title": "ExecCommandApprovalRequest" + } + ] + }, + "ClientNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClientNotification", + "oneOf": [ + { + "type": "object", + "required": [ + "method" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "initialized" + ], + "title": "InitializedNotificationMethod" + } + }, + "title": "InitializedNotification" + } + ] + }, + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "FuzzyFileSearchResult": { + "description": "Superset of [`codex_file_search::FileMatch`]", + "type": "object", + "required": [ + "file_name", + "match_type", + "path", + "root", + "score" + ], + "properties": { + "file_name": { + "type": "string" + }, + "indices": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "match_type": { + "$ref": "#/definitions/FuzzyFileSearchMatchType" + }, + "path": { + "type": "string" + }, + "root": { + "type": "string" + }, + "score": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "FuzzyFileSearchSessionCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionCompletedNotification", + "type": "object", + "required": [ + "sessionId" + ], + "properties": { + "sessionId": { + "type": "string" + } + } + }, + "FuzzyFileSearchSessionUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionUpdatedNotification", + "type": "object", + "required": [ + "files", + "query", + "sessionId" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + }, + "query": { + "type": "string" + }, + "sessionId": { + "type": "string" + } + } + }, + "ServerNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerNotification", + "description": "Notification sent from the server to the client.", + "oneOf": [ + { + "description": "NEW NOTIFICATIONS", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "error" + ], + "title": "ErrorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ErrorNotification" + } + }, + "title": "ErrorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/started" + ], + "title": "Thread/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadStartedNotification" + } + }, + "title": "Thread/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/status/changed" + ], + "title": "Thread/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadStatusChangedNotification" + } + }, + "title": "Thread/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/archived" + ], + "title": "Thread/archivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadArchivedNotification" + } + }, + "title": "Thread/archivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/unarchived" + ], + "title": "Thread/unarchivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadUnarchivedNotification" + } + }, + "title": "Thread/unarchivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/closed" + ], + "title": "Thread/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadClosedNotification" + } + }, + "title": "Thread/closedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "skills/changed" + ], + "title": "Skills/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/SkillsChangedNotification" + } + }, + "title": "Skills/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/name/updated" + ], + "title": "Thread/name/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadNameUpdatedNotification" + } + }, + "title": "Thread/name/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/updated" + ], + "title": "Thread/goal/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadGoalUpdatedNotification" + } + }, + "title": "Thread/goal/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/cleared" + ], + "title": "Thread/goal/clearedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadGoalClearedNotification" + } + }, + "title": "Thread/goal/clearedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/tokenUsage/updated" + ], + "title": "Thread/tokenUsage/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadTokenUsageUpdatedNotification" + } + }, + "title": "Thread/tokenUsage/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/started" + ], + "title": "Turn/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnStartedNotification" + } + }, + "title": "Turn/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/started" + ], + "title": "Hook/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/HookStartedNotification" + } + }, + "title": "Hook/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/completed" + ], + "title": "Turn/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnCompletedNotification" + } + }, + "title": "Turn/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/completed" + ], + "title": "Hook/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/HookCompletedNotification" + } + }, + "title": "Hook/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/diff/updated" + ], + "title": "Turn/diff/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnDiffUpdatedNotification" + } + }, + "title": "Turn/diff/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/plan/updated" + ], + "title": "Turn/plan/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/TurnPlanUpdatedNotification" + } + }, + "title": "Turn/plan/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/started" + ], + "title": "Item/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ItemStartedNotification" + } + }, + "title": "Item/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/started" + ], + "title": "Item/autoApprovalReview/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ItemGuardianApprovalReviewStartedNotification" + } + }, + "title": "Item/autoApprovalReview/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/completed" + ], + "title": "Item/autoApprovalReview/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ItemGuardianApprovalReviewCompletedNotification" + } + }, + "title": "Item/autoApprovalReview/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/completed" + ], + "title": "Item/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ItemCompletedNotification" + } + }, + "title": "Item/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/agentMessage/delta" + ], + "title": "Item/agentMessage/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/AgentMessageDeltaNotification" + } + }, + "title": "Item/agentMessage/deltaNotification" + }, + { + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/plan/delta" + ], + "title": "Item/plan/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/PlanDeltaNotification" + } + }, + "title": "Item/plan/deltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `command/exec` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "command/exec/outputDelta" + ], + "title": "Command/exec/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecOutputDeltaNotification" + } + }, + "title": "Command/exec/outputDeltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/outputDelta" + ], + "title": "Process/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ProcessOutputDeltaNotification" + } + }, + "title": "Process/outputDeltaNotification" + }, + { + "description": "Final exit notification for a `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/exited" + ], + "title": "Process/exitedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ProcessExitedNotification" + } + }, + "title": "Process/exitedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/outputDelta" + ], + "title": "Item/commandExecution/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/CommandExecutionOutputDeltaNotification" + } + }, + "title": "Item/commandExecution/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/terminalInteraction" + ], + "title": "Item/commandExecution/terminalInteractionNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/TerminalInteractionNotification" + } + }, + "title": "Item/commandExecution/terminalInteractionNotification" + }, + { + "description": "Deprecated legacy apply_patch output stream notification.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/outputDelta" + ], + "title": "Item/fileChange/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/FileChangeOutputDeltaNotification" + } + }, + "title": "Item/fileChange/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/patchUpdated" + ], + "title": "Item/fileChange/patchUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/FileChangePatchUpdatedNotification" + } + }, + "title": "Item/fileChange/patchUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "serverRequest/resolved" + ], + "title": "ServerRequest/resolvedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ServerRequestResolvedNotification" + } + }, + "title": "ServerRequest/resolvedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/mcpToolCall/progress" + ], + "title": "Item/mcpToolCall/progressNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpToolCallProgressNotification" + } + }, + "title": "Item/mcpToolCall/progressNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/oauthLogin/completed" + ], + "title": "McpServer/oauthLogin/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpServerOauthLoginCompletedNotification" + } + }, + "title": "McpServer/oauthLogin/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/startupStatus/updated" + ], + "title": "McpServer/startupStatus/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/McpServerStatusUpdatedNotification" + } + }, + "title": "McpServer/startupStatus/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/updated" + ], + "title": "Account/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/AccountUpdatedNotification" + } + }, + "title": "Account/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/rateLimits/updated" + ], + "title": "Account/rateLimits/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/AccountRateLimitsUpdatedNotification" + } + }, + "title": "Account/rateLimits/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "app/list/updated" + ], + "title": "App/list/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/AppListUpdatedNotification" + } + }, + "title": "App/list/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "remoteControl/status/changed" + ], + "title": "RemoteControl/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/RemoteControlStatusChangedNotification" + } + }, + "title": "RemoteControl/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import/completed" + ], + "title": "ExternalAgentConfig/import/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ExternalAgentConfigImportCompletedNotification" + } + }, + "title": "ExternalAgentConfig/import/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fs/changed" + ], + "title": "Fs/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/FsChangedNotification" + } + }, + "title": "Fs/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryTextDelta" + ], + "title": "Item/reasoning/summaryTextDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ReasoningSummaryTextDeltaNotification" + } + }, + "title": "Item/reasoning/summaryTextDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryPartAdded" + ], + "title": "Item/reasoning/summaryPartAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ReasoningSummaryPartAddedNotification" + } + }, + "title": "Item/reasoning/summaryPartAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/textDelta" + ], + "title": "Item/reasoning/textDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ReasoningTextDeltaNotification" + } + }, + "title": "Item/reasoning/textDeltaNotification" + }, + { + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/compacted" + ], + "title": "Thread/compactedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ContextCompactedNotification" + } + }, + "title": "Thread/compactedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/rerouted" + ], + "title": "Model/reroutedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ModelReroutedNotification" + } + }, + "title": "Model/reroutedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/verification" + ], + "title": "Model/verificationNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ModelVerificationNotification" + } + }, + "title": "Model/verificationNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "warning" + ], + "title": "WarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/WarningNotification" + } + }, + "title": "WarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "guardianWarning" + ], + "title": "GuardianWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/GuardianWarningNotification" + } + }, + "title": "GuardianWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "deprecationNotice" + ], + "title": "DeprecationNoticeNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/DeprecationNoticeNotification" + } + }, + "title": "DeprecationNoticeNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "configWarning" + ], + "title": "ConfigWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ConfigWarningNotification" + } + }, + "title": "ConfigWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionUpdated" + ], + "title": "FuzzyFileSearch/sessionUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionUpdatedNotification" + } + }, + "title": "FuzzyFileSearch/sessionUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionCompleted" + ], + "title": "FuzzyFileSearch/sessionCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionCompletedNotification" + } + }, + "title": "FuzzyFileSearch/sessionCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/started" + ], + "title": "Thread/realtime/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeStartedNotification" + } + }, + "title": "Thread/realtime/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/itemAdded" + ], + "title": "Thread/realtime/itemAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeItemAddedNotification" + } + }, + "title": "Thread/realtime/itemAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/delta" + ], + "title": "Thread/realtime/transcript/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeTranscriptDeltaNotification" + } + }, + "title": "Thread/realtime/transcript/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/done" + ], + "title": "Thread/realtime/transcript/doneNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeTranscriptDoneNotification" + } + }, + "title": "Thread/realtime/transcript/doneNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/outputAudio/delta" + ], + "title": "Thread/realtime/outputAudio/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeOutputAudioDeltaNotification" + } + }, + "title": "Thread/realtime/outputAudio/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/sdp" + ], + "title": "Thread/realtime/sdpNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeSdpNotification" + } + }, + "title": "Thread/realtime/sdpNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/error" + ], + "title": "Thread/realtime/errorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeErrorNotification" + } + }, + "title": "Thread/realtime/errorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/closed" + ], + "title": "Thread/realtime/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/ThreadRealtimeClosedNotification" + } + }, + "title": "Thread/realtime/closedNotification" + }, + { + "description": "Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windows/worldWritableWarning" + ], + "title": "Windows/worldWritableWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/WindowsWorldWritableWarningNotification" + } + }, + "title": "Windows/worldWritableWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupCompleted" + ], + "title": "WindowsSandbox/setupCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/WindowsSandboxSetupCompletedNotification" + } + }, + "title": "WindowsSandbox/setupCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/login/completed" + ], + "title": "Account/login/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/v2/AccountLoginCompletedNotification" + } + }, + "title": "Account/login/completedNotification" + } + ] + }, + "v2": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "DynamicToolSpec": { + "type": "object", + "required": [ + "description", + "inputSchema", + "name" + ], + "properties": { + "deferLoading": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + } + } + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStartSource": { + "type": "string", + "enum": [ + "startup", + "clear" + ] + }, + "TurnEnvironmentParams": { + "type": "object", + "required": [ + "cwd", + "environmentId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "environmentId": { + "type": "string" + } + } + }, + "ThreadStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartParams", + "type": "object", + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sessionStartSource": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadStartSource" + }, + { + "type": "null" + } + ] + }, + "ephemeral": { + "type": [ + "boolean", + "null" + ] + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/v2/Personality" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "serviceName": { + "type": [ + "string", + "null" + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType" + } + }, + "title": "InputTextContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType" + } + }, + "title": "InputImageContentItem" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType" + } + }, + "title": "OutputTextContentItem" + } + ] + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/v2/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType" + } + }, + "title": "InputTextFunctionCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType" + } + }, + "title": "InputImageFunctionCallOutputContentItem" + } + ] + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "title": "ExecLocalShellAction" + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType" + } + }, + "title": "ReasoningTextReasoningItemContent" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType" + } + }, + "title": "TextReasoningItemContent" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType" + } + }, + "title": "SummaryTextReasoningItemReasoningSummary" + } + ] + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ContentItem" + } + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/v2/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "title": "MessageResponseItemType" + } + }, + "title": "MessageResponseItem" + }, + { + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType" + } + }, + "title": "ReasoningResponseItem" + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/v2/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/v2/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType" + } + }, + "title": "LocalShellCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType" + } + }, + "title": "FunctionCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "execution", + "type" + ], + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType" + } + }, + "title": "ToolSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/v2/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType" + } + }, + "title": "FunctionCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType" + } + }, + "title": "CustomToolCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "output": { + "$ref": "#/definitions/v2/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType" + } + }, + "title": "CustomToolCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "execution", + "status", + "tools", + "type" + ], + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "type": "array", + "items": true + }, + "type": { + "type": "string", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType" + } + }, + "title": "ToolSearchOutputResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType" + } + }, + "title": "WebSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType" + } + }, + "title": "ImageGenerationCallResponseItem" + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType" + } + }, + "title": "CompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType" + } + }, + "title": "CompactionTriggerResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType" + } + }, + "title": "ContextCompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponseItemType" + } + }, + "title": "OtherResponseItem" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType" + } + }, + "title": "SearchResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType" + } + }, + "title": "OtherResponsesApiWebSearchAction" + } + ] + }, + "ThreadResumeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeParams", + "description": "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nThe precedence is: history > path > thread_id. If using history or path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "model": { + "description": "Configuration overrides for the resumed thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/v2/Personality" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadForkParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkParams", + "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "ephemeral": { + "type": "boolean" + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this forked thread.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "model": { + "description": "Configuration overrides for the forked thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadArchiveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadUnsubscribeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "AccountLoginCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountLoginCompletedNotification", + "type": "object", + "required": [ + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "loginId": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + } + } + }, + "WindowsSandboxSetupCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupCompletedNotification", + "type": "object", + "required": [ + "mode", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "$ref": "#/definitions/v2/WindowsSandboxSetupMode" + }, + "success": { + "type": "boolean" + } + } + }, + "ThreadSetNameParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameParams", + "type": "object", + "required": [ + "name", + "threadId" + ], + "properties": { + "name": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadGoalStatus": { + "type": "string", + "enum": [ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete" + ] + }, + "WindowsWorldWritableWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsWorldWritableWarningNotification", + "type": "object", + "required": [ + "extraCount", + "failedScan", + "samplePaths" + ], + "properties": { + "extraCount": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "failedScan": { + "type": "boolean" + }, + "samplePaths": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ThreadRealtimeClosedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeClosedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime transport closes.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeErrorNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeErrorNotification", + "description": "EXPERIMENTAL - emitted when thread realtime encounters an error.", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadMetadataGitInfoUpdateParams": { + "type": "object", + "properties": { + "branch": { + "description": "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "description": "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadMetadataUpdateParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "gitInfo": { + "description": "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadMetadataGitInfoUpdateParams" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadMemoryMode": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + }, + "ThreadRealtimeSdpNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeSdpNotification", + "description": "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", + "type": "object", + "required": [ + "sdp", + "threadId" + ], + "properties": { + "sdp": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadUnarchiveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadCompactStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadShellCommandParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandParams", + "type": "object", + "required": [ + "command", + "threadId" + ], + "properties": { + "command": { + "description": "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadApproveGuardianDeniedActionParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionParams", + "type": "object", + "required": [ + "event", + "threadId" + ], + "properties": { + "event": { + "description": "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`." + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeOutputAudioDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeOutputAudioDeltaNotification", + "description": "EXPERIMENTAL - streamed output audio emitted by thread realtime.", + "type": "object", + "required": [ + "audio", + "threadId" + ], + "properties": { + "audio": { + "$ref": "#/definitions/v2/ThreadRealtimeAudioChunk" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRollbackParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackParams", + "type": "object", + "required": [ + "numTurns", + "threadId" + ], + "properties": { + "numTurns": { + "description": "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "type": "string" + } + } + }, + "SortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "ThreadListCwdFilter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ThreadSortKey": { + "type": "string", + "enum": [ + "created_at", + "updated_at" + ] + }, + "ThreadSourceKind": { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown" + ] + }, + "ThreadListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListParams", + "type": "object", + "properties": { + "archived": { + "description": "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", + "type": [ + "boolean", + "null" + ] + }, + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadListCwdFilter" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "modelProviders": { + "description": "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "searchTerm": { + "description": "Optional substring filter for the extracted thread title.", + "type": [ + "string", + "null" + ] + }, + "sortDirection": { + "description": "Optional sort direction; defaults to descending (newest first).", + "anyOf": [ + { + "$ref": "#/definitions/v2/SortDirection" + }, + { + "type": "null" + } + ] + }, + "sortKey": { + "description": "Optional sort key; defaults to created_at.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadSortKey" + }, + { + "type": "null" + } + ] + }, + "sourceKinds": { + "description": "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/ThreadSourceKind" + } + }, + "useStateDbOnly": { + "description": "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", + "type": "boolean" + } + } + }, + "ThreadLoadedListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to no limit.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "includeTurns": { + "description": "When true, include turns and their items from rollout history.", + "default": false, + "type": "boolean" + }, + "threadId": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "ThreadRealtimeTranscriptDoneNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDoneNotification", + "description": "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", + "type": "object", + "required": [ + "role", + "text", + "threadId" + ], + "properties": { + "role": { + "type": "string" + }, + "text": { + "description": "Final complete text for the transcript part.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeTranscriptDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDeltaNotification", + "description": "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", + "type": "object", + "required": [ + "delta", + "role", + "threadId" + ], + "properties": { + "delta": { + "description": "Live transcript delta from the realtime event.", + "type": "string" + }, + "role": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadInjectItemsParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsParams", + "type": "object", + "required": [ + "items", + "threadId" + ], + "properties": { + "items": { + "description": "Raw Responses API items to append to the thread's model-visible history.", + "type": "array", + "items": true + }, + "threadId": { + "type": "string" + } + } + }, + "SkillsListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + }, + "forceReload": { + "description": "When true, bypass the skills cache and re-scan skills from disk.", + "type": "boolean" + } + } + }, + "HooksListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MarketplaceAddParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddParams", + "type": "object", + "required": [ + "source" + ], + "properties": { + "refName": { + "type": [ + "string", + "null" + ] + }, + "source": { + "type": "string" + }, + "sparsePaths": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "MarketplaceRemoveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveParams", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceUpgradeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeParams", + "type": "object", + "properties": { + "marketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginListMarketplaceKind": { + "type": "string", + "enum": [ + "local", + "workspace-directory", + "shared-with-me" + ] + }, + "PluginListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "marketplaceKinds": { + "description": "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/PluginListMarketplaceKind" + } + } + } + }, + "PluginInstalledParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "installSuggestionPluginNames": { + "description": "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginSkillReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadParams", + "type": "object", + "required": [ + "remoteMarketplaceName", + "remotePluginId", + "skillName" + ], + "properties": { + "remoteMarketplaceName": { + "type": "string" + }, + "remotePluginId": { + "type": "string" + }, + "skillName": { + "type": "string" + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginShareTarget": { + "type": "object", + "required": [ + "principalId", + "principalType", + "role" + ], + "properties": { + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/v2/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/v2/PluginShareTargetRole" + } + } + }, + "PluginShareTargetRole": { + "type": "string", + "enum": [ + "reader", + "editor" + ] + }, + "PluginShareSaveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveParams", + "type": "object", + "required": [ + "pluginPath" + ], + "properties": { + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/v2/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "pluginPath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "remotePluginId": { + "type": [ + "string", + "null" + ] + }, + "shareTargets": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/PluginShareTarget" + } + } + } + }, + "PluginShareUpdateDiscoverability": { + "type": "string", + "enum": [ + "UNLISTED", + "PRIVATE" + ] + }, + "PluginShareUpdateTargetsParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsParams", + "type": "object", + "required": [ + "discoverability", + "remotePluginId", + "shareTargets" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/v2/PluginShareUpdateDiscoverability" + }, + "remotePluginId": { + "type": "string" + }, + "shareTargets": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginShareTarget" + } + } + } + }, + "PluginShareListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListParams", + "type": "object" + }, + "PluginShareCheckoutParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "PluginShareDeleteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "AppsListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListParams", + "description": "EXPERIMENTAL - list available apps/connectors.", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "forceRefetch": { + "description": "When true, bypass app caches and fetch the latest data from sources.", + "type": "boolean" + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional thread id used to evaluate app feature gating from that thread's config.", + "type": [ + "string", + "null" + ] + } + } + }, + "FsReadFileParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileParams", + "description": "Read a file from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to read.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsWriteFileParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileParams", + "description": "Write a file on the host filesystem.", + "type": "object", + "required": [ + "dataBase64", + "path" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + }, + "path": { + "description": "Absolute path to write.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsCreateDirectoryParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryParams", + "description": "Create a directory on the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to create.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether parent directories should also be created. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsGetMetadataParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataParams", + "description": "Request metadata for an absolute path.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to inspect.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsReadDirectoryParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryParams", + "description": "List direct child names for a directory.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to read.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsRemoveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveParams", + "description": "Remove a file or directory tree from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "force": { + "description": "Whether missing paths should be ignored. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + }, + "path": { + "description": "Absolute path to remove.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether directory removal should recurse. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsCopyParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyParams", + "description": "Copy a file or directory tree on the host filesystem.", + "type": "object", + "required": [ + "destinationPath", + "sourcePath" + ], + "properties": { + "destinationPath": { + "description": "Absolute destination path.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Required for directory copies; ignored for file copies.", + "type": "boolean" + }, + "sourcePath": { + "description": "Absolute source path.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsWatchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchParams", + "description": "Start filesystem watch notifications for an absolute path.", + "type": "object", + "required": [ + "path", + "watchId" + ], + "properties": { + "path": { + "description": "Absolute file or directory path to watch.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "watchId": { + "description": "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", + "type": "string" + } + } + }, + "FsUnwatchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchParams", + "description": "Stop filesystem watch notifications for a prior `fs/watch`.", + "type": "object", + "required": [ + "watchId" + ], + "properties": { + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "SkillsConfigWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteParams", + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "description": "Name-based selector.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Path-based selector.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + } + } + }, + "PluginInstallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginUninstallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallParams", + "type": "object", + "required": [ + "pluginId" + ], + "properties": { + "pluginId": { + "type": "string" + } + } + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "type": "object", + "required": [ + "mode", + "settings" + ], + "properties": { + "mode": { + "$ref": "#/definitions/v2/ModeKind" + }, + "settings": { + "$ref": "#/definitions/v2/Settings" + } + } + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "type": "string", + "enum": [ + "plan", + "default" + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/v2/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "type": "object", + "required": [ + "model" + ], + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + } + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/v2/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "TurnStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartParams", + "type": "object", + "required": [ + "input", + "threadId" + ], + "properties": { + "approvalPolicy": { + "description": "Override the approval policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "description": "Override the service tier for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Override the working directory for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "effort": { + "description": "Override the reasoning effort for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/UserInput" + } + }, + "model": { + "description": "Override the model for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "outputSchema": { + "description": "Optional JSON Schema used to constrain the final assistant message for this turn." + }, + "summary": { + "description": "Override the reasoning summary for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "personality": { + "description": "Override the personality for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/Personality" + }, + { + "type": "null" + } + ] + }, + "sandboxPolicy": { + "description": "Override the sandbox policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxPolicy" + }, + { + "type": "null" + } + ] + } + } + }, + "TurnSteerParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerParams", + "type": "object", + "required": [ + "expectedTurnId", + "input", + "threadId" + ], + "properties": { + "expectedTurnId": { + "description": "Required active turn id precondition. The request fails when it does not match the currently active turn.", + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/UserInput" + } + }, + "threadId": { + "type": "string" + } + } + }, + "TurnInterruptParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptParams", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RealtimeOutputModality": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "RealtimeVoice": { + "type": "string", + "enum": [ + "alloy", + "arbor", + "ash", + "ballad", + "breeze", + "cedar", + "coral", + "cove", + "echo", + "ember", + "juniper", + "maple", + "marin", + "sage", + "shimmer", + "sol", + "spruce", + "vale", + "verse" + ] + }, + "ThreadRealtimeStartTransport": { + "description": "EXPERIMENTAL - transport used by thread realtime.", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ], + "title": "WebsocketThreadRealtimeStartTransportType" + } + }, + "title": "WebsocketThreadRealtimeStartTransport" + }, + { + "type": "object", + "required": [ + "sdp", + "type" + ], + "properties": { + "sdp": { + "description": "SDP offer generated by a WebRTC RTCPeerConnection after configuring audio and the realtime events data channel.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webrtc" + ], + "title": "WebrtcThreadRealtimeStartTransportType" + } + }, + "title": "WebrtcThreadRealtimeStartTransport" + } + ] + }, + "ThreadRealtimeItemAddedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeItemAddedNotification", + "description": "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + "type": "object", + "required": [ + "item", + "threadId" + ], + "properties": { + "item": true, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeAudioChunk": { + "description": "EXPERIMENTAL - thread realtime audio chunk.", + "type": "object", + "required": [ + "data", + "numChannels", + "sampleRate" + ], + "properties": { + "data": { + "type": "string" + }, + "itemId": { + "type": [ + "string", + "null" + ] + }, + "numChannels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sampleRate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samplesPerChannel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadRealtimeStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeStartedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime startup is accepted.", + "type": "object", + "required": [ + "threadId", + "version" + ], + "properties": { + "realtimeSessionId": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/v2/RealtimeConversationVersion" + } + } + }, + "RealtimeConversationVersion": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + }, + "ConfigWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWarningNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance or error details.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Optional path to the config file that triggered the warning.", + "type": [ + "string", + "null" + ] + }, + "range": { + "description": "Optional range for the error location inside the config file.", + "anyOf": [ + { + "$ref": "#/definitions/v2/TextRange" + }, + { + "type": "null" + } + ] + }, + "summary": { + "description": "Concise summary of the warning.", + "type": "string" + } + } + }, + "TextRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "$ref": "#/definitions/v2/TextPosition" + }, + "start": { + "$ref": "#/definitions/v2/TextPosition" + } + } + }, + "ReviewDelivery": { + "type": "string", + "enum": [ + "inline", + "detached" + ] + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "uncommittedChanges" + ], + "title": "UncommittedChangesReviewTargetType" + } + }, + "title": "UncommittedChangesReviewTarget" + }, + { + "description": "Review changes between the current branch and the given base branch.", + "type": "object", + "required": [ + "branch", + "type" + ], + "properties": { + "branch": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "baseBranch" + ], + "title": "BaseBranchReviewTargetType" + } + }, + "title": "BaseBranchReviewTarget" + }, + { + "description": "Review the changes introduced by a specific commit.", + "type": "object", + "required": [ + "sha", + "type" + ], + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "commit" + ], + "title": "CommitReviewTargetType" + } + }, + "title": "CommitReviewTarget" + }, + { + "description": "Arbitrary instructions, equivalent to the old free-form prompt.", + "type": "object", + "required": [ + "instructions", + "type" + ], + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ], + "title": "CustomReviewTargetType" + } + }, + "title": "CustomReviewTarget" + } + ] + }, + "ReviewStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartParams", + "type": "object", + "required": [ + "target", + "threadId" + ], + "properties": { + "delivery": { + "description": "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/ReviewDelivery" + }, + { + "type": "null" + } + ] + }, + "target": { + "$ref": "#/definitions/v2/ReviewTarget" + }, + "threadId": { + "type": "string" + } + } + }, + "ModelListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "includeHidden": { + "description": "When true, include models that are hidden from the default picker list.", + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ModelProviderCapabilitiesReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadParams", + "type": "object" + }, + "ExperimentalFeatureListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", + "type": [ + "string", + "null" + ] + } + } + }, + "ExperimentalFeatureEnablementSetParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetParams", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "TextPosition": { + "type": "object", + "required": [ + "column", + "line" + ], + "properties": { + "column": { + "description": "1-based column number (in Unicode scalar values).", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "line": { + "description": "1-based line number.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "DeprecationNoticeNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DeprecationNoticeNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + } + } + }, + "GuardianWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GuardianWarningNotification", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "description": "Concise guardian warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Thread target for the guardian warning.", + "type": "string" + } + } + }, + "McpServerOauthLoginParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginParams", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "timeoutSecs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "McpServerStatusDetail": { + "type": "string", + "enum": [ + "full", + "toolsAndAuthOnly" + ] + }, + "ListMcpServerStatusParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "detail": { + "description": "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", + "anyOf": [ + { + "$ref": "#/definitions/v2/McpServerStatusDetail" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a server-defined value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "McpResourceReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadParams", + "type": "object", + "required": [ + "server", + "uri" + ], + "properties": { + "server": { + "type": "string" + }, + "threadId": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "McpServerToolCallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallParams", + "type": "object", + "required": [ + "server", + "threadId", + "tool" + ], + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + } + }, + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + }, + "WindowsSandboxSetupStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartParams", + "type": "object", + "required": [ + "mode" + ], + "properties": { + "cwd": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mode": { + "$ref": "#/definitions/v2/WindowsSandboxSetupMode" + } + } + }, + "LoginAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountParams", + "oneOf": [ + { + "type": "object", + "required": [ + "apiKey", + "type" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountParamsType" + } + }, + "title": "ApiKeyv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "codexStreamlinedLogin": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountParamsType" + } + }, + "title": "Chatgptv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountParamsType" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountParams" + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId", + "type" + ], + "properties": { + "accessToken": { + "description": "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", + "type": "string" + }, + "chatgptAccountId": { + "description": "Workspace/account identifier supplied by the client.", + "type": "string" + }, + "chatgptPlanType": { + "description": "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountParamsType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountParams" + } + ] + }, + "CancelLoginAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountParams", + "type": "object", + "required": [ + "loginId" + ], + "properties": { + "loginId": { + "type": "string" + } + } + }, + "AddCreditsNudgeCreditType": { + "type": "string", + "enum": [ + "credits", + "usage_limit" + ] + }, + "SendAddCreditsNudgeEmailParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailParams", + "type": "object", + "required": [ + "creditType" + ], + "properties": { + "creditType": { + "$ref": "#/definitions/v2/AddCreditsNudgeCreditType" + } + } + }, + "FeedbackUploadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadParams", + "type": "object", + "required": [ + "classification", + "includeLogs" + ], + "properties": { + "classification": { + "type": "string" + }, + "extraLogFiles": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeLogs": { + "type": "boolean" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "tags": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "threadId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "CommandExecTerminalSize": { + "description": "PTY size in character cells for `command/exec` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "CommandExecParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecParams", + "description": "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", + "type": "object", + "required": [ + "command" + ], + "properties": { + "command": { + "description": "Command argv vector. Empty arrays are rejected.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "Optional working directory. Defaults to the server cwd.", + "type": [ + "string", + "null" + ] + }, + "disableOutputCap": { + "description": "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + "type": "boolean" + }, + "disableTimeout": { + "description": "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + "type": "boolean" + }, + "env": { + "description": "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": [ + "string", + "null" + ] + } + }, + "outputBytesCap": { + "description": "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "tty": { + "description": "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + "type": "boolean" + }, + "processId": { + "description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + "type": [ + "string", + "null" + ] + }, + "sandboxPolicy": { + "description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxPolicy" + }, + { + "type": "null" + } + ] + }, + "size": { + "description": "Optional initial PTY size in character cells. Only valid when `tty` is true.", + "anyOf": [ + { + "$ref": "#/definitions/v2/CommandExecTerminalSize" + }, + { + "type": "null" + } + ] + }, + "streamStdin": { + "description": "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + "type": "boolean" + }, + "streamStdoutStderr": { + "description": "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + "type": "boolean" + }, + "timeoutMs": { + "description": "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "CommandExecWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteParams", + "description": "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "closeStdin": { + "description": "Close stdin after writing `deltaBase64`, if present.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Optional base64-encoded stdin bytes to write.", + "type": [ + "string", + "null" + ] + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandExecTerminateParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateParams", + "description": "Terminate a running `command/exec` session.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandExecResizeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeParams", + "description": "Resize a running PTY-backed `command/exec` session.", + "type": "object", + "required": [ + "processId", + "size" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "size": { + "description": "New PTY size in character cells.", + "allOf": [ + { + "$ref": "#/definitions/v2/CommandExecTerminalSize" + } + ] + } + } + }, + "ProcessTerminalSize": { + "description": "PTY size in character cells for `process/spawn` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "WarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WarningNotification", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "Concise warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Optional thread target when the warning applies to a specific thread.", + "type": [ + "string", + "null" + ] + } + } + }, + "ModelVerificationNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelVerificationNotification", + "type": "object", + "required": [ + "threadId", + "turnId", + "verifications" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "verifications": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ModelVerification" + } + } + } + }, + "ModelVerification": { + "type": "string", + "enum": [ + "trustedAccessForCyber" + ] + }, + "ModelReroutedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelReroutedNotification", + "type": "object", + "required": [ + "fromModel", + "reason", + "threadId", + "toModel", + "turnId" + ], + "properties": { + "fromModel": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/v2/ModelRerouteReason" + }, + "threadId": { + "type": "string" + }, + "toModel": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ConfigReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadParams", + "type": "object", + "properties": { + "cwd": { + "description": "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", + "type": [ + "string", + "null" + ] + }, + "includeLayers": { + "default": false, + "type": "boolean" + } + } + }, + "ExternalAgentConfigDetectParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectParams", + "type": "object", + "properties": { + "cwds": { + "description": "Zero or more working directories to include for repo-scoped detection.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeHome": { + "description": "If true, include detection under the user's home (~/.claude, ~/.codex, etc.).", + "type": "boolean" + } + } + }, + "CommandMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigMigrationItem": { + "type": "object", + "required": [ + "description", + "itemType" + ], + "properties": { + "cwd": { + "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "$ref": "#/definitions/v2/MigrationDetails" + }, + { + "type": "null" + } + ] + }, + "itemType": { + "$ref": "#/definitions/v2/ExternalAgentConfigMigrationItemType" + } + } + }, + "ExternalAgentConfigMigrationItemType": { + "type": "string", + "enum": [ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "SESSIONS" + ] + }, + "HookMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "McpServerMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "MigrationDetails": { + "type": "object", + "properties": { + "commands": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/CommandMigration" + } + }, + "hooks": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/HookMigration" + } + }, + "mcpServers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/McpServerMigration" + } + }, + "plugins": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginsMigration" + } + }, + "sessions": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/SessionMigration" + } + }, + "subagents": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/SubagentMigration" + } + } + } + }, + "PluginsMigration": { + "type": "object", + "required": [ + "marketplaceName", + "pluginNames" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "pluginNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SessionMigration": { + "type": "object", + "required": [ + "cwd", + "path" + ], + "properties": { + "cwd": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "SubagentMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigImportParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportParams", + "type": "object", + "required": [ + "migrationItems" + ], + "properties": { + "migrationItems": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ExternalAgentConfigMigrationItem" + } + } + } + }, + "MergeStrategy": { + "type": "string", + "enum": [ + "replace", + "upsert" + ] + }, + "ConfigValueWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigValueWriteParams", + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/v2/MergeStrategy" + }, + "value": true + } + }, + "ConfigEdit": { + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/v2/MergeStrategy" + }, + "value": true + } + }, + "ConfigBatchWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigBatchWriteParams", + "type": "object", + "required": [ + "edits" + ], + "properties": { + "edits": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfigEdit" + } + }, + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "reloadUserConfig": { + "description": "When true, hot-reload the updated user config into all loaded threads after writing.", + "type": "boolean" + } + } + }, + "GetAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountParams", + "type": "object", + "properties": { + "refreshToken": { + "description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + "default": false, + "type": "boolean" + } + } + }, + "AgentPath": { + "type": "string" + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/v2/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/v2/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/v2/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/v2/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/v2/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/v2/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/v2/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/v2/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/v2/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/v2/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/v2/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/v2/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/v2/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/v2/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/v2/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/v2/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/v2/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/v2/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/v2/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + }, + "ThreadStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/v2/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/v2/SandboxPolicy" + } + ] + } + } + }, + "ThreadResumeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/v2/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/v2/SandboxPolicy" + } + ] + } + } + }, + "ThreadForkResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "approvalPolicy": { + "$ref": "#/definitions/v2/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "thread": { + "$ref": "#/definitions/v2/Thread" + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/v2/SandboxPolicy" + } + ] + } + } + }, + "ThreadArchiveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveResponse", + "type": "object" + }, + "ThreadUnsubscribeStatus": { + "type": "string", + "enum": [ + "notLoaded", + "notSubscribed", + "unsubscribed" + ] + }, + "ThreadUnsubscribeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/ThreadUnsubscribeStatus" + } + } + }, + "ModelRerouteReason": { + "type": "string", + "enum": [ + "highRiskCyberActivity" + ] + }, + "ContextCompactedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContextCompactedNotification", + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ThreadSetNameResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameResponse", + "type": "object" + }, + "ThreadGoal": { + "type": "object", + "required": [ + "createdAt", + "objective", + "status", + "threadId", + "timeUsedSeconds", + "tokensUsed", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "objective": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/ThreadGoalStatus" + }, + "threadId": { + "type": "string" + }, + "timeUsedSeconds": { + "type": "integer", + "format": "int64" + }, + "tokenBudget": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "tokensUsed": { + "type": "integer", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "format": "int64" + } + } + }, + "ReasoningTextDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningTextDeltaNotification", + "type": "object", + "required": [ + "contentIndex", + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "contentIndex": { + "type": "integer", + "format": "int64" + }, + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningSummaryPartAddedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryPartAddedNotification", + "type": "object", + "required": [ + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningSummaryTextDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryTextDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ThreadMetadataUpdateResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + } + } + }, + "FsChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsChangedNotification", + "description": "Filesystem watch notification emitted for `fs/watch` subscribers.", + "type": "object", + "required": [ + "changedPaths", + "watchId" + ], + "properties": { + "changedPaths": { + "description": "File or directory paths associated with this event.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "ExternalAgentConfigImportCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportCompletedNotification", + "type": "object" + }, + "ThreadUnarchiveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + } + } + }, + "ThreadCompactStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartResponse", + "type": "object" + }, + "ThreadShellCommandResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandResponse", + "type": "object" + }, + "ThreadApproveGuardianDeniedActionResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionResponse", + "type": "object" + }, + "RemoteControlStatusChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RemoteControlStatusChangedNotification", + "description": "Current remote-control connection status and remote identity exposed to clients.", + "type": "object", + "required": [ + "installationId", + "serverName", + "status" + ], + "properties": { + "environmentId": { + "type": [ + "string", + "null" + ] + }, + "installationId": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/RemoteControlConnectionStatus" + } + } + }, + "ThreadRollbackResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "description": "The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`.", + "allOf": [ + { + "$ref": "#/definitions/v2/Thread" + } + ] + } + } + }, + "ThreadListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "backwardsCursor": { + "description": "Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one thread. Use it with the opposite `sortDirection`; for timestamp sorts it anchors at the start of the page timestamp so same-second updates are not skipped.", + "type": [ + "string", + "null" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/Thread" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadLoadedListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "description": "Thread ids for sessions currently loaded in memory.", + "type": "array", + "items": { + "type": "string" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + } + } + }, + "AppListUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppListUpdatedNotification", + "description": "EXPERIMENTAL - notification emitted when the app list changes.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AppInfo" + } + } + } + }, + "AccountRateLimitsUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountRateLimitsUpdatedNotification", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "$ref": "#/definitions/v2/RateLimitSnapshot" + } + } + }, + "ThreadInjectItemsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsResponse", + "type": "object" + }, + "SkillDependencies": { + "type": "object", + "required": [ + "tools" + ], + "properties": { + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/SkillToolDependency" + } + } + } + }, + "SkillErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "SkillInterface": { + "type": "object", + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "iconLarge": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "iconSmall": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "SkillMetadata": { + "type": "object", + "required": [ + "description", + "enabled", + "name", + "path", + "scope" + ], + "properties": { + "dependencies": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SkillDependencies" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "scope": { + "$ref": "#/definitions/v2/SkillScope" + }, + "shortDescription": { + "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + "type": [ + "string", + "null" + ] + } + } + }, + "SkillScope": { + "type": "string", + "enum": [ + "user", + "repo", + "system", + "admin" + ] + }, + "SkillToolDependency": { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "transport": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "string" + } + } + }, + "SkillsListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "skills" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/SkillErrorInfo" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/SkillMetadata" + } + } + } + }, + "SkillsListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/SkillsListEntry" + } + } + } + }, + "HookErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookMetadata": { + "type": "object", + "required": [ + "currentHash", + "displayOrder", + "enabled", + "eventName", + "handlerType", + "isManaged", + "key", + "source", + "sourcePath", + "timeoutSec", + "trustStatus" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "currentHash": { + "type": "string" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "enabled": { + "type": "boolean" + }, + "eventName": { + "$ref": "#/definitions/v2/HookEventName" + }, + "handlerType": { + "$ref": "#/definitions/v2/HookHandlerType" + }, + "isManaged": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "matcher": { + "type": [ + "string", + "null" + ] + }, + "pluginId": { + "type": [ + "string", + "null" + ] + }, + "source": { + "$ref": "#/definitions/v2/HookSource" + }, + "sourcePath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "trustStatus": { + "$ref": "#/definitions/v2/HookTrustStatus" + } + } + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + }, + "HookTrustStatus": { + "type": "string", + "enum": [ + "managed", + "untrusted", + "trusted", + "modified" + ] + }, + "HooksListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "hooks", + "warnings" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/HookErrorInfo" + } + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/HookMetadata" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "HooksListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/HooksListEntry" + } + } + } + }, + "MarketplaceAddResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddResponse", + "type": "object", + "required": [ + "alreadyAdded", + "installedRoot", + "marketplaceName" + ], + "properties": { + "alreadyAdded": { + "type": "boolean" + }, + "installedRoot": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceRemoveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveResponse", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "installedRoot": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceUpgradeErrorInfo": { + "type": "object", + "required": [ + "marketplaceName", + "message" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "MarketplaceUpgradeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeResponse", + "type": "object", + "required": [ + "errors", + "selectedMarketplaces", + "upgradedRoots" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/MarketplaceUpgradeErrorInfo" + } + }, + "selectedMarketplaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "upgradedRoots": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + } + } + }, + "MarketplaceInterface": { + "type": "object", + "properties": { + "displayName": { + "type": [ + "string", + "null" + ] + } + } + }, + "MarketplaceLoadErrorInfo": { + "type": "object", + "required": [ + "marketplacePath", + "message" + ], + "properties": { + "marketplacePath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "message": { + "type": "string" + } + } + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginMarketplaceEntry": { + "type": "object", + "required": [ + "name", + "plugins" + ], + "properties": { + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/v2/MarketplaceInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "description": "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugins": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginSummary" + } + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/v2/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/v2/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/v2/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/v2/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/v2/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/v2/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/v2/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/v2/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/v2/PluginSource" + } + } + }, + "PluginListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "featuredPluginIds": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginMarketplaceEntry" + } + } + } + }, + "PluginInstalledResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginMarketplaceEntry" + } + } + } + }, + "AppSummary": { + "description": "EXPERIMENTAL - app metadata summary for plugin responses.", + "type": "object", + "required": [ + "id", + "name", + "needsAuth" + ], + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "needsAuth": { + "type": "boolean" + } + } + }, + "PluginDetail": { + "type": "object", + "required": [ + "apps", + "hooks", + "marketplaceName", + "mcpServers", + "skills", + "summary" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AppSummary" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginHookSummary" + } + }, + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mcpServers": { + "type": "array", + "items": { + "type": "string" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/SkillSummary" + } + }, + "summary": { + "$ref": "#/definitions/v2/PluginSummary" + } + } + }, + "PluginHookSummary": { + "type": "object", + "required": [ + "eventName", + "key" + ], + "properties": { + "eventName": { + "$ref": "#/definitions/v2/HookEventName" + }, + "key": { + "type": "string" + } + } + }, + "SkillSummary": { + "type": "object", + "required": [ + "description", + "enabled", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadResponse", + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "plugin": { + "$ref": "#/definitions/v2/PluginDetail" + } + } + }, + "PluginSkillReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadResponse", + "type": "object", + "properties": { + "contents": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareSaveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveResponse", + "type": "object", + "required": [ + "remotePluginId", + "shareUrl" + ], + "properties": { + "remotePluginId": { + "type": "string" + }, + "shareUrl": { + "type": "string" + } + } + }, + "PluginShareUpdateTargetsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsResponse", + "type": "object", + "required": [ + "discoverability", + "principals" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/v2/PluginShareDiscoverability" + }, + "principals": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginSharePrincipal" + } + } + } + }, + "PluginShareListItem": { + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "localPluginPath": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugin": { + "$ref": "#/definitions/v2/PluginSummary" + } + } + }, + "PluginShareListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/PluginShareListItem" + } + } + } + }, + "PluginShareCheckoutResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutResponse", + "type": "object", + "required": [ + "marketplaceName", + "marketplacePath", + "pluginId", + "pluginName", + "pluginPath", + "remotePluginId" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "pluginId": { + "type": "string" + }, + "pluginName": { + "type": "string" + }, + "pluginPath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDeleteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteResponse", + "type": "object" + }, + "AppBranding": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "isDiscoverableApp" + ], + "properties": { + "category": { + "type": [ + "string", + "null" + ] + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "isDiscoverableApp": { + "type": "boolean" + }, + "privacyPolicy": { + "type": [ + "string", + "null" + ] + }, + "termsOfService": { + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppInfo": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "appMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppMetadata" + }, + { + "type": "null" + } + ] + }, + "branding": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppBranding" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "distributionChannel": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "isAccessible": { + "default": false, + "type": "boolean" + }, + "isEnabled": { + "description": "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + "default": true, + "type": "boolean" + }, + "labels": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "logoUrl": { + "type": [ + "string", + "null" + ] + }, + "logoUrlDark": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "pluginDisplayNames": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AppMetadata": { + "type": "object", + "properties": { + "categories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "firstPartyRequiresInstall": { + "type": [ + "boolean", + "null" + ] + }, + "firstPartyType": { + "type": [ + "string", + "null" + ] + }, + "review": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppReview" + }, + { + "type": "null" + } + ] + }, + "screenshots": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AppScreenshot" + } + }, + "seoDescription": { + "type": [ + "string", + "null" + ] + }, + "showInComposerWhenUnlinked": { + "type": [ + "boolean", + "null" + ] + }, + "subCategories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "version": { + "type": [ + "string", + "null" + ] + }, + "versionId": { + "type": [ + "string", + "null" + ] + }, + "versionNotes": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppReview": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string" + } + } + }, + "AppScreenshot": { + "type": "object", + "required": [ + "userPrompt" + ], + "properties": { + "fileId": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "userPrompt": { + "type": "string" + } + } + }, + "AppsListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListResponse", + "description": "EXPERIMENTAL - app list response.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AppInfo" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "FsReadFileResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileResponse", + "description": "Base64-encoded file contents returned by `fs/readFile`.", + "type": "object", + "required": [ + "dataBase64" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + } + } + }, + "FsWriteFileResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileResponse", + "description": "Successful response for `fs/writeFile`.", + "type": "object" + }, + "FsCreateDirectoryResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryResponse", + "description": "Successful response for `fs/createDirectory`.", + "type": "object" + }, + "FsGetMetadataResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataResponse", + "description": "Metadata returned by `fs/getMetadata`.", + "type": "object", + "required": [ + "createdAtMs", + "isDirectory", + "isFile", + "isSymlink", + "modifiedAtMs" + ], + "properties": { + "createdAtMs": { + "description": "File creation time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + }, + "isDirectory": { + "description": "Whether the path resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether the path resolves to a regular file.", + "type": "boolean" + }, + "isSymlink": { + "description": "Whether the path itself is a symbolic link.", + "type": "boolean" + }, + "modifiedAtMs": { + "description": "File modification time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + } + } + }, + "FsReadDirectoryEntry": { + "description": "A directory entry returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "fileName", + "isDirectory", + "isFile" + ], + "properties": { + "fileName": { + "description": "Direct child entry name only, not an absolute or relative path.", + "type": "string" + }, + "isDirectory": { + "description": "Whether this entry resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether this entry resolves to a regular file.", + "type": "boolean" + } + } + }, + "FsReadDirectoryResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryResponse", + "description": "Directory entries returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "entries" + ], + "properties": { + "entries": { + "description": "Direct child entries in the requested directory.", + "type": "array", + "items": { + "$ref": "#/definitions/v2/FsReadDirectoryEntry" + } + } + } + }, + "FsRemoveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveResponse", + "description": "Successful response for `fs/remove`.", + "type": "object" + }, + "FsCopyResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyResponse", + "description": "Successful response for `fs/copy`.", + "type": "object" + }, + "FsWatchResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchResponse", + "description": "Successful response for `fs/watch`.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Canonicalized path associated with the watch.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + } + } + }, + "FsUnwatchResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchResponse", + "description": "Successful response for `fs/unwatch`.", + "type": "object" + }, + "SkillsConfigWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteResponse", + "type": "object", + "required": [ + "effectiveEnabled" + ], + "properties": { + "effectiveEnabled": { + "type": "boolean" + } + } + }, + "PluginInstallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallResponse", + "type": "object", + "required": [ + "appsNeedingAuth", + "authPolicy" + ], + "properties": { + "appsNeedingAuth": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AppSummary" + } + }, + "authPolicy": { + "$ref": "#/definitions/v2/PluginAuthPolicy" + } + } + }, + "PluginUninstallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallResponse", + "type": "object" + }, + "TurnStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartResponse", + "type": "object", + "required": [ + "turn" + ], + "properties": { + "turn": { + "$ref": "#/definitions/v2/Turn" + } + } + }, + "TurnSteerResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerResponse", + "type": "object", + "required": [ + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + } + } + }, + "TurnInterruptResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptResponse", + "type": "object" + }, + "AccountUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountUpdatedNotification", + "type": "object", + "properties": { + "authMode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AuthMode" + }, + { + "type": "null" + } + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/v2/PlanType" + }, + { + "type": "null" + } + ] + } + } + }, + "AuthMode": { + "description": "Authentication mode for OpenAI-backed providers.", + "oneOf": [ + { + "description": "OpenAI API key provided by the caller and stored by Codex.", + "type": "string", + "enum": [ + "apikey" + ] + }, + { + "description": "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + "type": "string", + "enum": [ + "chatgpt" + ] + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + "type": "string", + "enum": [ + "chatgptAuthTokens" + ] + }, + { + "description": "Programmatic Codex auth backed by a registered Agent Identity.", + "type": "string", + "enum": [ + "agentIdentity" + ] + } + ] + }, + "McpServerStatusUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerStatusUpdatedNotification", + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/v2/McpServerStartupState" + } + } + }, + "McpServerStartupState": { + "type": "string", + "enum": [ + "starting", + "ready", + "failed", + "cancelled" + ] + }, + "RealtimeVoicesList": { + "type": "object", + "required": [ + "defaultV1", + "defaultV2", + "v1", + "v2" + ], + "properties": { + "defaultV1": { + "$ref": "#/definitions/v2/RealtimeVoice" + }, + "defaultV2": { + "$ref": "#/definitions/v2/RealtimeVoice" + }, + "v1": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/RealtimeVoice" + } + }, + "v2": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/RealtimeVoice" + } + } + } + }, + "McpServerOauthLoginCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginCompletedNotification", + "type": "object", + "required": [ + "name", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "ReviewStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartResponse", + "type": "object", + "required": [ + "reviewThreadId", + "turn" + ], + "properties": { + "reviewThreadId": { + "description": "Identifies the thread where the review runs.\n\nFor inline reviews, this is the original thread id. For detached reviews, this is the id of the new review thread.", + "type": "string" + }, + "turn": { + "$ref": "#/definitions/v2/Turn" + } + } + }, + "InputModality": { + "description": "Canonical user-input modality tags advertised by a model.", + "oneOf": [ + { + "description": "Plain text turns and tool payloads.", + "type": "string", + "enum": [ + "text" + ] + }, + { + "description": "Image attachments included in user turns.", + "type": "string", + "enum": [ + "image" + ] + } + ] + }, + "Model": { + "type": "object", + "required": [ + "defaultReasoningEffort", + "description", + "displayName", + "hidden", + "id", + "isDefault", + "model", + "supportedReasoningEfforts" + ], + "properties": { + "additionalSpeedTiers": { + "description": "Deprecated: use `serviceTiers` instead.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "availabilityNux": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ModelAvailabilityNux" + }, + { + "type": "null" + } + ] + }, + "defaultReasoningEffort": { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "inputModalities": { + "default": [ + "text", + "image" + ], + "type": "array", + "items": { + "$ref": "#/definitions/v2/InputModality" + } + }, + "isDefault": { + "type": "boolean" + }, + "model": { + "type": "string" + }, + "serviceTiers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/v2/ModelServiceTier" + } + }, + "supportedReasoningEfforts": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ReasoningEffortOption" + } + }, + "supportsPersonality": { + "default": false, + "type": "boolean" + }, + "upgrade": { + "type": [ + "string", + "null" + ] + }, + "upgradeInfo": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ModelUpgradeInfo" + }, + { + "type": "null" + } + ] + } + } + }, + "ModelAvailabilityNux": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "ModelServiceTier": { + "type": "object", + "required": [ + "description", + "id", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ModelUpgradeInfo": { + "type": "object", + "required": [ + "model" + ], + "properties": { + "migrationMarkdown": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "modelLink": { + "type": [ + "string", + "null" + ] + }, + "upgradeCopy": { + "type": [ + "string", + "null" + ] + } + } + }, + "ReasoningEffortOption": { + "type": "object", + "required": [ + "description", + "reasoningEffort" + ], + "properties": { + "description": { + "type": "string" + }, + "reasoningEffort": { + "$ref": "#/definitions/v2/ReasoningEffort" + } + } + }, + "ModelListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/Model" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ModelProviderCapabilitiesReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadResponse", + "type": "object", + "required": [ + "imageGeneration", + "namespaceTools", + "webSearch" + ], + "properties": { + "imageGeneration": { + "type": "boolean" + }, + "namespaceTools": { + "type": "boolean" + }, + "webSearch": { + "type": "boolean" + } + } + }, + "ExperimentalFeature": { + "type": "object", + "required": [ + "defaultEnabled", + "enabled", + "name", + "stage" + ], + "properties": { + "announcement": { + "description": "Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "defaultEnabled": { + "description": "Whether this feature is enabled by default.", + "type": "boolean" + }, + "description": { + "description": "Short summary describing what the feature does. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "displayName": { + "description": "User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "enabled": { + "description": "Whether this feature is currently enabled in the loaded config.", + "type": "boolean" + }, + "name": { + "description": "Stable key used in config.toml and CLI flag toggles.", + "type": "string" + }, + "stage": { + "description": "Lifecycle stage of this feature flag.", + "allOf": [ + { + "$ref": "#/definitions/v2/ExperimentalFeatureStage" + } + ] + } + } + }, + "ExperimentalFeatureStage": { + "oneOf": [ + { + "description": "Feature is available for user testing and feedback.", + "type": "string", + "enum": [ + "beta" + ] + }, + { + "description": "Feature is still being built and not ready for broad use.", + "type": "string", + "enum": [ + "underDevelopment" + ] + }, + { + "description": "Feature is production-ready.", + "type": "string", + "enum": [ + "stable" + ] + }, + { + "description": "Feature is deprecated and should be avoided.", + "type": "string", + "enum": [ + "deprecated" + ] + }, + { + "description": "Feature flag is retained only for backwards compatibility.", + "type": "string", + "enum": [ + "removed" + ] + } + ] + }, + "ExperimentalFeatureListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ExperimentalFeature" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ExperimentalFeatureEnablementSetResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetResponse", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Feature enablement entries updated by this request.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "RemoteControlConnectionStatus": { + "type": "string", + "enum": [ + "disabled", + "connecting", + "connected", + "errored" + ] + }, + "McpToolCallProgressNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpToolCallProgressNotification", + "type": "object", + "required": [ + "itemId", + "message", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ServerRequestResolvedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerRequestResolvedNotification", + "type": "object", + "required": [ + "requestId", + "threadId" + ], + "properties": { + "requestId": { + "$ref": "#/definitions/v2/RequestId" + }, + "threadId": { + "type": "string" + } + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "CollaborationModeMask": { + "description": "EXPERIMENTAL - collaboration mode preset metadata for clients.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ModeKind" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + { + "type": "null" + } + ] + } + } + }, + "FileChangePatchUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangePatchUpdatedNotification", + "type": "object", + "required": [ + "changes", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/FileUpdateChange" + } + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "FileChangeOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeOutputDeltaNotification", + "description": "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TerminalInteractionNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TerminalInteractionNotification", + "type": "object", + "required": [ + "itemId", + "processId", + "stdin", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "processId": { + "type": "string" + }, + "stdin": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "McpServerOauthLoginResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginResponse", + "type": "object", + "required": [ + "authorizationUrl" + ], + "properties": { + "authorizationUrl": { + "type": "string" + } + } + }, + "McpServerRefreshResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerRefreshResponse", + "type": "object" + }, + "McpAuthStatus": { + "type": "string", + "enum": [ + "unsupported", + "notLoggedIn", + "bearerToken", + "oAuth" + ] + }, + "McpServerStatus": { + "type": "object", + "required": [ + "authStatus", + "name", + "resourceTemplates", + "resources", + "tools" + ], + "properties": { + "authStatus": { + "$ref": "#/definitions/v2/McpAuthStatus" + }, + "name": { + "type": "string" + }, + "resourceTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ResourceTemplate" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/Resource" + } + }, + "tools": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2/Tool" + } + } + } + }, + "Resource": { + "description": "A known resource that the server is capable of reading.", + "type": "object", + "required": [ + "name", + "uri" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "ResourceTemplate": { + "description": "A template description for resources available on the server.", + "type": "object", + "required": [ + "name", + "uriTemplate" + ], + "properties": { + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uriTemplate": { + "type": "string" + } + } + }, + "Tool": { + "description": "Definition for a tool the client can call.", + "type": "object", + "required": [ + "inputSchema", + "name" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "outputSchema": true, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "ListMcpServerStatusResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/McpServerStatus" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ResourceContent": { + "description": "Contents returned when reading a resource from an MCP server.", + "anyOf": [ + { + "type": "object", + "required": [ + "text", + "uri" + ], + "properties": { + "_meta": true, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": "string" + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "blob", + "uri" + ], + "properties": { + "_meta": true, + "blob": { + "type": "string" + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + } + ] + }, + "McpResourceReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadResponse", + "type": "object", + "required": [ + "contents" + ], + "properties": { + "contents": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ResourceContent" + } + } + } + }, + "McpServerToolCallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallResponse", + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + } + }, + "WindowsSandboxSetupStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartResponse", + "type": "object", + "required": [ + "started" + ], + "properties": { + "started": { + "type": "boolean" + } + } + }, + "WindowsSandboxReadiness": { + "type": "string", + "enum": [ + "ready", + "notConfigured", + "updateRequired" + ] + }, + "WindowsSandboxReadinessResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxReadinessResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/WindowsSandboxReadiness" + } + } + }, + "LoginAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountResponse", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountResponseType" + } + }, + "title": "ApiKeyv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "authUrl", + "loginId", + "type" + ], + "properties": { + "authUrl": { + "description": "URL the client should open in a browser to initiate the OAuth flow.", + "type": "string" + }, + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountResponseType" + } + }, + "title": "Chatgptv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "loginId", + "type", + "userCode", + "verificationUrl" + ], + "properties": { + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountResponseType" + }, + "userCode": { + "description": "One-time code the user must enter after signing in.", + "type": "string" + }, + "verificationUrl": { + "description": "URL the client should open in a browser to complete device code authorization.", + "type": "string" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountResponseType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountResponse" + } + ] + }, + "CancelLoginAccountStatus": { + "type": "string", + "enum": [ + "canceled", + "notFound" + ] + }, + "CancelLoginAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/CancelLoginAccountStatus" + } + } + }, + "LogoutAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LogoutAccountResponse", + "type": "object" + }, + "CreditsSnapshot": { + "type": "object", + "required": [ + "hasCredits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "hasCredits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + }, + "RateLimitReachedType": { + "type": "string", + "enum": [ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/v2/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limitId": { + "type": [ + "string", + "null" + ] + }, + "limitName": { + "type": [ + "string", + "null" + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/v2/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/v2/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "rateLimitReachedType": { + "anyOf": [ + { + "$ref": "#/definitions/v2/RateLimitReachedType" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/v2/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "usedPercent" + ], + "properties": { + "resetsAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "usedPercent": { + "type": "integer", + "format": "int32" + }, + "windowDurationMins": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "GetAccountRateLimitsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountRateLimitsResponse", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "description": "Backward-compatible single-bucket view; mirrors the historical payload.", + "allOf": [ + { + "$ref": "#/definitions/v2/RateLimitSnapshot" + } + ] + }, + "rateLimitsByLimitId": { + "description": "Multi-bucket view keyed by metered `limit_id` (for example, `codex`).", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/v2/RateLimitSnapshot" + } + } + } + }, + "AddCreditsNudgeEmailStatus": { + "type": "string", + "enum": [ + "sent", + "cooldown_active" + ] + }, + "SendAddCreditsNudgeEmailResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/AddCreditsNudgeEmailStatus" + } + } + }, + "FeedbackUploadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadResponse", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "CommandExecResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResponse", + "description": "Final buffered result for `command/exec`.", + "type": "object", + "required": [ + "exitCode", + "stderr", + "stdout" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `command/exec/outputDelta`.", + "type": "string" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `command/exec/outputDelta`.", + "type": "string" + } + } + }, + "CommandExecWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteResponse", + "description": "Empty success response for `command/exec/write`.", + "type": "object" + }, + "CommandExecTerminateResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateResponse", + "description": "Empty success response for `command/exec/terminate`.", + "type": "object" + }, + "CommandExecResizeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeResponse", + "description": "Empty success response for `command/exec/resize`.", + "type": "object" + }, + "CommandExecutionOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionOutputDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ProcessExitedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessExitedNotification", + "description": "Final process exit notification for `process/spawn`.", + "type": "object", + "required": [ + "exitCode", + "processHandle", + "stderr", + "stderrCapReached", + "stdout", + "stdoutCapReached" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `process/outputDelta`.", + "type": "string" + }, + "stderrCapReached": { + "description": "Whether stderr reached `outputBytesCap`.\n\nIn streaming mode, stderr is empty and cap state is also reported on the final stderr `process/outputDelta` notification.", + "type": "boolean" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `process/outputDelta`.", + "type": "string" + }, + "stdoutCapReached": { + "description": "Whether stdout reached `outputBytesCap`.\n\nIn streaming mode, stdout is empty and cap state is also reported on the final stdout `process/outputDelta` notification.", + "type": "boolean" + } + } + }, + "ProcessOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processHandle", + "stream" + ], + "properties": { + "capReached": { + "description": "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stream": { + "description": "Output stream this chunk belongs to.", + "allOf": [ + { + "$ref": "#/definitions/v2/ProcessOutputStream" + } + ] + } + } + }, + "ProcessOutputStream": { + "description": "Stream label for `process/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "AnalyticsConfig": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": true + }, + "AppConfig": { + "type": "object", + "properties": { + "default_tools_approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "default_tools_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "destructive_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppToolsConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppToolApproval": { + "type": "string", + "enum": [ + "auto", + "prompt", + "approve" + ] + }, + "AppToolConfig": { + "type": "object", + "properties": { + "approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AppToolsConfig": { + "type": "object" + }, + "AppsConfig": { + "type": "object", + "properties": { + "_default": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/v2/AppsDefaultConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppsDefaultConfig": { + "type": "object", + "properties": { + "destructive_enabled": { + "default": true, + "type": "boolean" + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "default": true, + "type": "boolean" + } + } + }, + "Config": { + "type": "object", + "properties": { + "analytics": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AnalyticsConfig" + }, + { + "type": "null" + } + ] + }, + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional default for where approval requests are routed for review.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchMode" + }, + { + "type": "null" + } + ] + }, + "compact_prompt": { + "type": [ + "string", + "null" + ] + }, + "desktop": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "forced_chatgpt_workspace_id": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ForcedChatgptWorkspaceIds" + }, + { + "type": "null" + } + ] + }, + "forced_login_method": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ForcedLoginMethod" + }, + { + "type": "null" + } + ] + }, + "instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_auto_compact_token_limit": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_context_window": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/v2/Verbosity" + }, + { + "type": "null" + } + ] + }, + "profile": { + "type": [ + "string", + "null" + ] + }, + "profiles": { + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2/ProfileV2" + } + }, + "review_model": { + "type": [ + "string", + "null" + ] + }, + "sandbox_mode": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sandbox_workspace_write": { + "anyOf": [ + { + "$ref": "#/definitions/v2/SandboxWorkspaceWrite" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ToolsV2" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "ConfigLayer": { + "type": "object", + "required": [ + "config", + "name", + "version" + ], + "properties": { + "config": true, + "disabledReason": { + "type": [ + "string", + "null" + ] + }, + "name": { + "$ref": "#/definitions/v2/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerMetadata": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "$ref": "#/definitions/v2/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerSource": { + "oneOf": [ + { + "description": "Managed preferences layer delivered by MDM (macOS only).", + "type": "object", + "required": [ + "domain", + "key", + "type" + ], + "properties": { + "domain": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mdm" + ], + "title": "MdmConfigLayerSourceType" + } + }, + "title": "MdmConfigLayerSource" + }, + { + "description": "Managed config layer from a file (usually `managed_config.toml`).", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the system config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "system" + ], + "title": "SystemConfigLayerSourceType" + } + }, + "title": "SystemConfigLayerSource" + }, + { + "description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "profile": { + "description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "user" + ], + "title": "UserConfigLayerSourceType" + } + }, + "title": "UserConfigLayerSource" + }, + { + "description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + "type": "object", + "required": [ + "dotCodexFolder", + "type" + ], + "properties": { + "dotCodexFolder": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "project" + ], + "title": "ProjectConfigLayerSourceType" + } + }, + "title": "ProjectConfigLayerSource" + }, + { + "description": "Session-layer overrides supplied via `-c`/`--config`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "sessionFlags" + ], + "title": "SessionFlagsConfigLayerSourceType" + } + }, + "title": "SessionFlagsConfigLayerSource" + }, + { + "description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromFile" + ], + "title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromFileConfigLayerSource" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromMdm" + ], + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSource" + } + ] + }, + "ForcedChatgptWorkspaceIds": { + "description": "Backward-compatible API shape for ChatGPT workspace login restrictions.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ForcedLoginMethod": { + "type": "string", + "enum": [ + "chatgpt", + "api" + ] + }, + "ProfileV2": { + "type": "object", + "properties": { + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional profile-level override for where approval requests are routed for review. If omitted, the enclosing config default is used.", + "anyOf": [ + { + "$ref": "#/definitions/v2/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "chatgpt_base_url": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/v2/Verbosity" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ToolsV2" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchMode" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "SandboxWorkspaceWrite": { + "type": "object", + "properties": { + "exclude_slash_tmp": { + "default": false, + "type": "boolean" + }, + "exclude_tmpdir_env_var": { + "default": false, + "type": "boolean" + }, + "network_access": { + "default": false, + "type": "boolean" + }, + "writable_roots": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ToolsV2": { + "type": "object", + "properties": { + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchToolConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "Verbosity": { + "description": "Controls output length/detail on GPT-5 models via the Responses API. Serialized with lowercase values to match the OpenAI API.", + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchContextSize": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchLocation": { + "type": "object", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "region": { + "type": [ + "string", + "null" + ] + }, + "timezone": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WebSearchMode": { + "type": "string", + "enum": [ + "disabled", + "cached", + "live" + ] + }, + "WebSearchToolConfig": { + "type": "object", + "properties": { + "allowed_domains": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "context_size": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchContextSize" + }, + { + "type": "null" + } + ] + }, + "location": { + "anyOf": [ + { + "$ref": "#/definitions/v2/WebSearchLocation" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ConfigReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadResponse", + "type": "object", + "required": [ + "config", + "origins" + ], + "properties": { + "config": { + "$ref": "#/definitions/v2/Config" + }, + "layers": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/ConfigLayer" + } + }, + "origins": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2/ConfigLayerMetadata" + } + } + } + }, + "ExternalAgentConfigDetectResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectResponse", + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ExternalAgentConfigMigrationItem" + } + } + } + }, + "ExternalAgentConfigImportResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportResponse", + "type": "object" + }, + "OverriddenMetadata": { + "type": "object", + "required": [ + "effectiveValue", + "message", + "overridingLayer" + ], + "properties": { + "effectiveValue": true, + "message": { + "type": "string" + }, + "overridingLayer": { + "$ref": "#/definitions/v2/ConfigLayerMetadata" + } + } + }, + "WriteStatus": { + "type": "string", + "enum": [ + "ok", + "okOverridden" + ] + }, + "ConfigWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWriteResponse", + "type": "object", + "required": [ + "filePath", + "status", + "version" + ], + "properties": { + "filePath": { + "description": "Canonical path to the config file that was written.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "overriddenMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/v2/OverriddenMetadata" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/v2/WriteStatus" + }, + "version": { + "type": "string" + } + } + }, + "ConfigRequirements": { + "type": "object", + "properties": { + "allowManagedHooksOnly": { + "type": [ + "boolean", + "null" + ] + }, + "allowedApprovalPolicies": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AskForApproval" + } + }, + "featureRequirements": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "boolean" + } + }, + "allowedSandboxModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/SandboxMode" + } + }, + "allowedWebSearchModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/WebSearchMode" + } + }, + "enforceResidency": { + "anyOf": [ + { + "$ref": "#/definitions/v2/ResidencyRequirement" + }, + { + "type": "null" + } + ] + } + } + }, + "ConfiguredHookHandler": { + "oneOf": [ + { + "type": "object", + "required": [ + "async", + "command", + "type" + ], + "properties": { + "async": { + "type": "boolean" + }, + "command": { + "type": "string" + }, + "commandWindows": { + "type": [ + "string", + "null" + ] + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandConfiguredHookHandlerType" + } + }, + "title": "CommandConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "prompt" + ], + "title": "PromptConfiguredHookHandlerType" + } + }, + "title": "PromptConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "agent" + ], + "title": "AgentConfiguredHookHandlerType" + } + }, + "title": "AgentConfiguredHookHandler" + } + ] + }, + "ConfiguredHookMatcherGroup": { + "type": "object", + "required": [ + "hooks" + ], + "properties": { + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookHandler" + } + }, + "matcher": { + "type": [ + "string", + "null" + ] + } + } + }, + "ManagedHooksRequirements": { + "type": "object", + "required": [ + "PermissionRequest", + "PostCompact", + "PostToolUse", + "PreCompact", + "PreToolUse", + "SessionStart", + "Stop", + "UserPromptSubmit" + ], + "properties": { + "PermissionRequest": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "PostCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "PostToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "PreCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "PreToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "SessionStart": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "Stop": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "UserPromptSubmit": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/ConfiguredHookMatcherGroup" + } + }, + "managedDir": { + "type": [ + "string", + "null" + ] + }, + "windowsManagedDir": { + "type": [ + "string", + "null" + ] + } + } + }, + "NetworkDomainPermission": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "NetworkRequirements": { + "type": "object", + "properties": { + "allowLocalBinding": { + "type": [ + "boolean", + "null" + ] + }, + "allowUnixSockets": { + "description": "Legacy compatibility view derived from `unix_sockets`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "allowUpstreamProxy": { + "type": [ + "boolean", + "null" + ] + }, + "allowedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "dangerouslyAllowAllUnixSockets": { + "type": [ + "boolean", + "null" + ] + }, + "dangerouslyAllowNonLoopbackProxy": { + "type": [ + "boolean", + "null" + ] + }, + "deniedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "domains": { + "description": "Canonical network permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/v2/NetworkDomainPermission" + } + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + }, + "httpPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "managedAllowedDomainsOnly": { + "description": "When true, only managed allowlist entries are respected while managed network enforcement is active.", + "type": [ + "boolean", + "null" + ] + }, + "socksPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "unixSockets": { + "description": "Canonical unix socket permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/v2/NetworkUnixSocketPermission" + } + } + } + }, + "NetworkUnixSocketPermission": { + "type": "string", + "enum": [ + "allow", + "none" + ] + }, + "ResidencyRequirement": { + "type": "string", + "enum": [ + "us" + ] + }, + "ConfigRequirementsReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigRequirementsReadResponse", + "type": "object", + "properties": { + "requirements": { + "description": "Null if no requirements are configured (e.g. no requirements.toml/MDM entries).", + "anyOf": [ + { + "$ref": "#/definitions/v2/ConfigRequirements" + }, + { + "type": "null" + } + ] + } + } + }, + "Account": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyAccountType" + } + }, + "title": "ApiKeyAccount" + }, + { + "type": "object", + "required": [ + "email", + "planType", + "type" + ], + "properties": { + "email": { + "type": "string" + }, + "planType": { + "$ref": "#/definitions/v2/PlanType" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "ChatgptAccountType" + } + }, + "title": "ChatgptAccount" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "amazonBedrock" + ], + "title": "AmazonBedrockAccountType" + } + }, + "title": "AmazonBedrockAccount" + } + ] + }, + "GetAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountResponse", + "type": "object", + "required": [ + "requiresOpenaiAuth" + ], + "properties": { + "account": { + "anyOf": [ + { + "$ref": "#/definitions/v2/Account" + }, + { + "type": "null" + } + ] + }, + "requiresOpenaiAuth": { + "type": "boolean" + } + } + }, + "ErrorNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ErrorNotification", + "type": "object", + "required": [ + "error", + "threadId", + "turnId", + "willRetry" + ], + "properties": { + "error": { + "$ref": "#/definitions/v2/TurnError" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "willRetry": { + "type": "boolean" + } + } + }, + "ThreadStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartedNotification", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/v2/Thread" + } + } + }, + "ThreadStatusChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStatusChangedNotification", + "type": "object", + "required": [ + "status", + "threadId" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/ThreadStatus" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadArchivedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadUnarchivedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadClosedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadClosedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "SkillsChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsChangedNotification", + "description": "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", + "type": "object" + }, + "ThreadNameUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadNameUpdatedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "threadName": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadGoalUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalUpdatedNotification", + "type": "object", + "required": [ + "goal", + "threadId" + ], + "properties": { + "goal": { + "$ref": "#/definitions/v2/ThreadGoal" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadGoalClearedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalClearedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadTokenUsage": { + "type": "object", + "required": [ + "last", + "total" + ], + "properties": { + "last": { + "$ref": "#/definitions/v2/TokenUsageBreakdown" + }, + "modelContextWindow": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "total": { + "$ref": "#/definitions/v2/TokenUsageBreakdown" + } + } + }, + "TokenUsageBreakdown": { + "type": "object", + "required": [ + "cachedInputTokens", + "inputTokens", + "outputTokens", + "reasoningOutputTokens", + "totalTokens" + ], + "properties": { + "cachedInputTokens": { + "type": "integer", + "format": "int64" + }, + "inputTokens": { + "type": "integer", + "format": "int64" + }, + "outputTokens": { + "type": "integer", + "format": "int64" + }, + "reasoningOutputTokens": { + "type": "integer", + "format": "int64" + }, + "totalTokens": { + "type": "integer", + "format": "int64" + } + } + }, + "ThreadTokenUsageUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadTokenUsageUpdatedNotification", + "type": "object", + "required": [ + "threadId", + "tokenUsage", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "tokenUsage": { + "$ref": "#/definitions/v2/ThreadTokenUsage" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/v2/Turn" + } + } + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/v2/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "displayOrder", + "entries", + "eventName", + "executionMode", + "handlerType", + "id", + "scope", + "sourcePath", + "startedAt", + "status" + ], + "properties": { + "completedAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "durationMs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/HookOutputEntry" + } + }, + "eventName": { + "$ref": "#/definitions/v2/HookEventName" + }, + "executionMode": { + "$ref": "#/definitions/v2/HookExecutionMode" + }, + "handlerType": { + "$ref": "#/definitions/v2/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/v2/HookScope" + }, + "source": { + "default": "unknown", + "allOf": [ + { + "$ref": "#/definitions/v2/HookSource" + } + ] + }, + "sourcePath": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "startedAt": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/v2/HookRunStatus" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "HookStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookStartedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/v2/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "TurnCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnCompletedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/v2/Turn" + } + } + }, + "HookCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookCompletedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/v2/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "TurnDiffUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnDiffUpdatedNotification", + "description": "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", + "type": "object", + "required": [ + "diff", + "threadId", + "turnId" + ], + "properties": { + "diff": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnPlanStep": { + "type": "object", + "required": [ + "status", + "step" + ], + "properties": { + "status": { + "$ref": "#/definitions/v2/TurnPlanStepStatus" + }, + "step": { + "type": "string" + } + } + }, + "TurnPlanStepStatus": { + "type": "string", + "enum": [ + "pending", + "inProgress", + "completed" + ] + }, + "TurnPlanUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnPlanUpdatedNotification", + "type": "object", + "required": [ + "plan", + "threadId", + "turnId" + ], + "properties": { + "explanation": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/TurnPlanStep" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemStartedNotification", + "type": "object", + "required": [ + "item", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/v2/ThreadItem" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/v2/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/v2/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/v2/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "GuardianApprovalReview": { + "description": "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "type": "object", + "required": [ + "status" + ], + "properties": { + "rationale": { + "type": [ + "string", + "null" + ] + }, + "riskLevel": { + "anyOf": [ + { + "$ref": "#/definitions/v2/GuardianRiskLevel" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/v2/GuardianApprovalReviewStatus" + }, + "userAuthorization": { + "anyOf": [ + { + "$ref": "#/definitions/v2/GuardianUserAuthorization" + }, + { + "type": "null" + } + ] + } + } + }, + "GuardianApprovalReviewAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "cwd", + "source", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "source": { + "$ref": "#/definitions/v2/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandGuardianApprovalReviewActionType" + } + }, + "title": "CommandGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "argv", + "cwd", + "program", + "source", + "type" + ], + "properties": { + "argv": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "program": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/v2/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "execve" + ], + "title": "ExecveGuardianApprovalReviewActionType" + } + }, + "title": "ExecveGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "cwd", + "files", + "type" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "applyPatch" + ], + "title": "ApplyPatchGuardianApprovalReviewActionType" + } + }, + "title": "ApplyPatchGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "host", + "port", + "protocol", + "target", + "type" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "protocol": { + "$ref": "#/definitions/v2/NetworkApprovalProtocol" + }, + "target": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "networkAccess" + ], + "title": "NetworkAccessGuardianApprovalReviewActionType" + } + }, + "title": "NetworkAccessGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "server", + "toolName", + "type" + ], + "properties": { + "connectorId": { + "type": [ + "string", + "null" + ] + }, + "connectorName": { + "type": [ + "string", + "null" + ] + }, + "server": { + "type": "string" + }, + "toolName": { + "type": "string" + }, + "toolTitle": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallGuardianApprovalReviewActionType" + } + }, + "title": "McpToolCallGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "permissions", + "type" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/v2/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "requestPermissions" + ], + "title": "RequestPermissionsGuardianApprovalReviewActionType" + } + }, + "title": "RequestPermissionsGuardianApprovalReviewAction" + } + ] + }, + "GuardianApprovalReviewStatus": { + "description": "[UNSTABLE] Lifecycle state for an approval auto-review.", + "type": "string", + "enum": [ + "inProgress", + "approved", + "denied", + "timedOut", + "aborted" + ] + }, + "GuardianCommandSource": { + "type": "string", + "enum": [ + "shell", + "unifiedExec" + ] + }, + "GuardianRiskLevel": { + "description": "[UNSTABLE] Risk level assigned by approval auto-review.", + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "GuardianUserAuthorization": { + "description": "[UNSTABLE] Authorization level assigned by approval auto-review.", + "type": "string", + "enum": [ + "unknown", + "low", + "medium", + "high" + ] + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ItemGuardianApprovalReviewStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewStartedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/v2/GuardianApprovalReviewAction" + }, + "review": { + "$ref": "#/definitions/v2/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AutoReviewDecisionSource": { + "description": "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + "type": "string", + "enum": [ + "agent" + ] + }, + "ItemGuardianApprovalReviewCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewCompletedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "completedAtMs", + "decisionSource", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/v2/GuardianApprovalReviewAction" + }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review completed.", + "type": "integer", + "format": "int64" + }, + "decisionSource": { + "$ref": "#/definitions/v2/AutoReviewDecisionSource" + }, + "review": { + "$ref": "#/definitions/v2/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemCompletedNotification", + "type": "object", + "required": [ + "completedAtMs", + "item", + "threadId", + "turnId" + ], + "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle completed.", + "type": "integer", + "format": "int64" + }, + "item": { + "$ref": "#/definitions/v2/ThreadItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RawResponseItemCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawResponseItemCompletedNotification", + "type": "object", + "required": [ + "item", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/v2/ResponseItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AgentMessageDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AgentMessageDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "PlanDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PlanDeltaNotification", + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "CommandExecOutputStream": { + "description": "Stream label for `command/exec/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "CommandExecOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processId", + "stream" + ], + "properties": { + "capReached": { + "description": "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "stream": { + "description": "Output stream for this chunk.", + "allOf": [ + { + "$ref": "#/definitions/v2/CommandExecOutputStream" + } + ] + } + } + } + }, + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "InitializeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InitializeResponse", + "type": "object", + "required": [ + "codexHome", + "platformFamily", + "platformOs", + "userAgent" + ], + "properties": { + "codexHome": { + "description": "Absolute path to the server's $CODEX_HOME directory.", + "allOf": [ + { + "$ref": "#/definitions/v2/AbsolutePathBuf" + } + ] + }, + "platformFamily": { + "description": "Platform family for the running app-server target, for example `\"unix\"` or `\"windows\"`.", + "type": "string" + }, + "platformOs": { + "description": "Operating system for the running app-server target, for example `\"macos\"`, `\"linux\"`, or `\"windows\"`.", + "type": "string" + }, + "userAgent": { + "type": "string" + } + } + }, + "FuzzyFileSearchResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchResponse", + "type": "object", + "required": [ + "files" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + } + } + }, + "AttestationGenerateResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AttestationGenerateResponse", + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "description": "Opaque client attestation token.", + "type": "string" + } + } + }, + "ChatgptAuthTokensRefreshResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ChatgptAuthTokensRefreshResponse", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId" + ], + "properties": { + "accessToken": { + "type": "string" + }, + "chatgptAccountId": { + "type": "string" + }, + "chatgptPlanType": { + "type": [ + "string", + "null" + ] + } + } + }, + "DynamicToolCallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DynamicToolCallResponse", + "type": "object", + "required": [ + "contentItems", + "success" + ], + "properties": { + "contentItems": { + "type": "array", + "items": { + "$ref": "#/definitions/v2/DynamicToolCallOutputContentItem" + } + }, + "success": { + "type": "boolean" + } + } + }, + "CommandExecutionRequestApprovalResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionRequestApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/CommandExecutionApprovalDecision" + } + } + }, + "FileChangeApprovalDecision": { + "oneOf": [ + { + "description": "User approved the file changes.", + "type": "string", + "enum": [ + "accept" + ] + }, + { + "description": "User approved the file changes and future changes to the same files should run without prompting.", + "type": "string", + "enum": [ + "acceptForSession" + ] + }, + { + "description": "User denied the file changes. The agent will continue the turn.", + "type": "string", + "enum": [ + "decline" + ] + }, + { + "description": "User denied the file changes. The turn will also be immediately interrupted.", + "type": "string", + "enum": [ + "cancel" + ] + } + ] + }, + "FileChangeRequestApprovalResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeRequestApprovalResponse", + "type": "object", + "required": [ + "decision" + ], + "properties": { + "decision": { + "$ref": "#/definitions/FileChangeApprovalDecision" + } + } + }, + "ToolRequestUserInputAnswer": { + "description": "EXPERIMENTAL. Captures a user's answer to a request_user_input question.", + "type": "object", + "required": [ + "answers" + ], + "properties": { + "answers": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ToolRequestUserInputResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ToolRequestUserInputResponse", + "description": "EXPERIMENTAL. Response payload mapping question ids to answers.", + "type": "object", + "required": [ + "answers" + ], + "properties": { + "answers": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ToolRequestUserInputAnswer" + } + } + } + }, + "McpServerElicitationAction": { + "type": "string", + "enum": [ + "accept", + "decline", + "cancel" + ] + }, + "McpServerElicitationRequestResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerElicitationRequestResponse", + "type": "object", + "required": [ + "action" + ], + "properties": { + "_meta": { + "description": "Optional client metadata for form-mode action handling." + }, + "action": { + "$ref": "#/definitions/McpServerElicitationAction" + }, + "content": { + "description": "Structured user input for accepted elicitations, mirroring RMCP `CreateElicitationResult`.\n\nThis is nullable because decline/cancel responses have no content." + } + } + }, + "GrantedPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/v2/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + } + }, + "PermissionGrantScope": { + "type": "string", + "enum": [ + "turn", + "session" + ] + }, + "PermissionsRequestApprovalResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PermissionsRequestApprovalResponse", + "type": "object", + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/GrantedPermissionProfile" + }, + "scope": { + "default": "turn", + "allOf": [ + { + "$ref": "#/definitions/PermissionGrantScope" + } + ] + }, + "strictAutoReview": { + "description": "Review every subsequent command in this turn before normal sandboxed execution.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/codex_app_server_protocol.v2.schemas.json b/schemas/codex_app_server_protocol.v2.schemas.json new file mode 100644 index 0000000..6c86f90 --- /dev/null +++ b/schemas/codex_app_server_protocol.v2.schemas.json @@ -0,0 +1,16358 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CodexAppServerProtocolV2", + "type": "object", + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "DynamicToolSpec": { + "type": "object", + "required": [ + "description", + "inputSchema", + "name" + ], + "properties": { + "deferLoading": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + } + } + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStartSource": { + "type": "string", + "enum": [ + "startup", + "clear" + ] + }, + "TurnEnvironmentParams": { + "type": "object", + "required": [ + "cwd", + "environmentId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "environmentId": { + "type": "string" + } + } + }, + "ThreadStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartParams", + "type": "object", + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sessionStartSource": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadStartSource" + }, + { + "type": "null" + } + ] + }, + "ephemeral": { + "type": [ + "boolean", + "null" + ] + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "serviceName": { + "type": [ + "string", + "null" + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType" + } + }, + "title": "InputTextContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType" + } + }, + "title": "InputImageContentItem" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType" + } + }, + "title": "OutputTextContentItem" + } + ] + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType" + } + }, + "title": "InputTextFunctionCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType" + } + }, + "title": "InputImageFunctionCallOutputContentItem" + } + ] + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "title": "ExecLocalShellAction" + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType" + } + }, + "title": "ReasoningTextReasoningItemContent" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType" + } + }, + "title": "TextReasoningItemContent" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType" + } + }, + "title": "SummaryTextReasoningItemReasoningSummary" + } + ] + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItem" + } + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "title": "MessageResponseItemType" + } + }, + "title": "MessageResponseItem" + }, + { + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType" + } + }, + "title": "ReasoningResponseItem" + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType" + } + }, + "title": "LocalShellCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType" + } + }, + "title": "FunctionCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "execution", + "type" + ], + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType" + } + }, + "title": "ToolSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType" + } + }, + "title": "FunctionCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType" + } + }, + "title": "CustomToolCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType" + } + }, + "title": "CustomToolCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "execution", + "status", + "tools", + "type" + ], + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "type": "array", + "items": true + }, + "type": { + "type": "string", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType" + } + }, + "title": "ToolSearchOutputResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType" + } + }, + "title": "WebSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType" + } + }, + "title": "ImageGenerationCallResponseItem" + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType" + } + }, + "title": "CompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType" + } + }, + "title": "CompactionTriggerResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType" + } + }, + "title": "ContextCompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponseItemType" + } + }, + "title": "OtherResponseItem" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType" + } + }, + "title": "SearchResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType" + } + }, + "title": "OtherResponsesApiWebSearchAction" + } + ] + }, + "ThreadResumeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeParams", + "description": "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nThe precedence is: history > path > thread_id. If using history or path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "model": { + "description": "Configuration overrides for the resumed thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadForkParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkParams", + "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "ephemeral": { + "type": "boolean" + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this forked thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "model": { + "description": "Configuration overrides for the forked thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadArchiveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadUnsubscribeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "AccountLoginCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountLoginCompletedNotification", + "type": "object", + "required": [ + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "loginId": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + } + } + }, + "WindowsSandboxSetupCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupCompletedNotification", + "type": "object", + "required": [ + "mode", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + }, + "success": { + "type": "boolean" + } + } + }, + "ThreadSetNameParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameParams", + "type": "object", + "required": [ + "name", + "threadId" + ], + "properties": { + "name": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadGoalStatus": { + "type": "string", + "enum": [ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete" + ] + }, + "WindowsWorldWritableWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsWorldWritableWarningNotification", + "type": "object", + "required": [ + "extraCount", + "failedScan", + "samplePaths" + ], + "properties": { + "extraCount": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "failedScan": { + "type": "boolean" + }, + "samplePaths": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ThreadRealtimeClosedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeClosedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime transport closes.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeErrorNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeErrorNotification", + "description": "EXPERIMENTAL - emitted when thread realtime encounters an error.", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadMetadataGitInfoUpdateParams": { + "type": "object", + "properties": { + "branch": { + "description": "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "description": "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadMetadataUpdateParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "gitInfo": { + "description": "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadMetadataGitInfoUpdateParams" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadMemoryMode": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + }, + "ThreadRealtimeSdpNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeSdpNotification", + "description": "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", + "type": "object", + "required": [ + "sdp", + "threadId" + ], + "properties": { + "sdp": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadUnarchiveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadCompactStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadShellCommandParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandParams", + "type": "object", + "required": [ + "command", + "threadId" + ], + "properties": { + "command": { + "description": "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadApproveGuardianDeniedActionParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionParams", + "type": "object", + "required": [ + "event", + "threadId" + ], + "properties": { + "event": { + "description": "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`." + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeOutputAudioDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeOutputAudioDeltaNotification", + "description": "EXPERIMENTAL - streamed output audio emitted by thread realtime.", + "type": "object", + "required": [ + "audio", + "threadId" + ], + "properties": { + "audio": { + "$ref": "#/definitions/ThreadRealtimeAudioChunk" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRollbackParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackParams", + "type": "object", + "required": [ + "numTurns", + "threadId" + ], + "properties": { + "numTurns": { + "description": "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "type": "string" + } + } + }, + "SortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "ThreadListCwdFilter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ThreadSortKey": { + "type": "string", + "enum": [ + "created_at", + "updated_at" + ] + }, + "ThreadSourceKind": { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown" + ] + }, + "ThreadListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListParams", + "type": "object", + "properties": { + "archived": { + "description": "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", + "type": [ + "boolean", + "null" + ] + }, + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadListCwdFilter" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "modelProviders": { + "description": "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "searchTerm": { + "description": "Optional substring filter for the extracted thread title.", + "type": [ + "string", + "null" + ] + }, + "sortDirection": { + "description": "Optional sort direction; defaults to descending (newest first).", + "anyOf": [ + { + "$ref": "#/definitions/SortDirection" + }, + { + "type": "null" + } + ] + }, + "sortKey": { + "description": "Optional sort key; defaults to created_at.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSortKey" + }, + { + "type": "null" + } + ] + }, + "sourceKinds": { + "description": "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ThreadSourceKind" + } + }, + "useStateDbOnly": { + "description": "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", + "type": "boolean" + } + } + }, + "ThreadLoadedListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to no limit.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "includeTurns": { + "description": "When true, include turns and their items from rollout history.", + "default": false, + "type": "boolean" + }, + "threadId": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "ThreadRealtimeTranscriptDoneNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDoneNotification", + "description": "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", + "type": "object", + "required": [ + "role", + "text", + "threadId" + ], + "properties": { + "role": { + "type": "string" + }, + "text": { + "description": "Final complete text for the transcript part.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeTranscriptDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDeltaNotification", + "description": "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", + "type": "object", + "required": [ + "delta", + "role", + "threadId" + ], + "properties": { + "delta": { + "description": "Live transcript delta from the realtime event.", + "type": "string" + }, + "role": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadInjectItemsParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsParams", + "type": "object", + "required": [ + "items", + "threadId" + ], + "properties": { + "items": { + "description": "Raw Responses API items to append to the thread's model-visible history.", + "type": "array", + "items": true + }, + "threadId": { + "type": "string" + } + } + }, + "SkillsListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + }, + "forceReload": { + "description": "When true, bypass the skills cache and re-scan skills from disk.", + "type": "boolean" + } + } + }, + "HooksListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MarketplaceAddParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddParams", + "type": "object", + "required": [ + "source" + ], + "properties": { + "refName": { + "type": [ + "string", + "null" + ] + }, + "source": { + "type": "string" + }, + "sparsePaths": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "MarketplaceRemoveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveParams", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceUpgradeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeParams", + "type": "object", + "properties": { + "marketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginListMarketplaceKind": { + "type": "string", + "enum": [ + "local", + "workspace-directory", + "shared-with-me" + ] + }, + "PluginListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "marketplaceKinds": { + "description": "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginListMarketplaceKind" + } + } + } + }, + "PluginInstalledParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "installSuggestionPluginNames": { + "description": "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } + }, + "PluginReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginSkillReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadParams", + "type": "object", + "required": [ + "remoteMarketplaceName", + "remotePluginId", + "skillName" + ], + "properties": { + "remoteMarketplaceName": { + "type": "string" + }, + "remotePluginId": { + "type": "string" + }, + "skillName": { + "type": "string" + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginShareTarget": { + "type": "object", + "required": [ + "principalId", + "principalType", + "role" + ], + "properties": { + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginShareTargetRole" + } + } + }, + "PluginShareTargetRole": { + "type": "string", + "enum": [ + "reader", + "editor" + ] + }, + "PluginShareSaveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveParams", + "type": "object", + "required": [ + "pluginPath" + ], + "properties": { + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "pluginPath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "remotePluginId": { + "type": [ + "string", + "null" + ] + }, + "shareTargets": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + } + }, + "PluginShareUpdateDiscoverability": { + "type": "string", + "enum": [ + "UNLISTED", + "PRIVATE" + ] + }, + "PluginShareUpdateTargetsParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsParams", + "type": "object", + "required": [ + "discoverability", + "remotePluginId", + "shareTargets" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/PluginShareUpdateDiscoverability" + }, + "remotePluginId": { + "type": "string" + }, + "shareTargets": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + } + }, + "PluginShareListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListParams", + "type": "object" + }, + "PluginShareCheckoutParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "PluginShareDeleteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } + }, + "AppsListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListParams", + "description": "EXPERIMENTAL - list available apps/connectors.", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "forceRefetch": { + "description": "When true, bypass app caches and fetch the latest data from sources.", + "type": "boolean" + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional thread id used to evaluate app feature gating from that thread's config.", + "type": [ + "string", + "null" + ] + } + } + }, + "FsReadFileParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileParams", + "description": "Read a file from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsWriteFileParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileParams", + "description": "Write a file on the host filesystem.", + "type": "object", + "required": [ + "dataBase64", + "path" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + }, + "path": { + "description": "Absolute path to write.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsCreateDirectoryParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryParams", + "description": "Create a directory on the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to create.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether parent directories should also be created. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsGetMetadataParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataParams", + "description": "Request metadata for an absolute path.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to inspect.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsReadDirectoryParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryParams", + "description": "List direct child names for a directory.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsRemoveParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveParams", + "description": "Remove a file or directory tree from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "force": { + "description": "Whether missing paths should be ignored. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + }, + "path": { + "description": "Absolute path to remove.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether directory removal should recurse. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + } + }, + "FsCopyParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyParams", + "description": "Copy a file or directory tree on the host filesystem.", + "type": "object", + "required": [ + "destinationPath", + "sourcePath" + ], + "properties": { + "destinationPath": { + "description": "Absolute destination path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Required for directory copies; ignored for file copies.", + "type": "boolean" + }, + "sourcePath": { + "description": "Absolute source path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsWatchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchParams", + "description": "Start filesystem watch notifications for an absolute path.", + "type": "object", + "required": [ + "path", + "watchId" + ], + "properties": { + "path": { + "description": "Absolute file or directory path to watch.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "watchId": { + "description": "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", + "type": "string" + } + } + }, + "FsUnwatchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchParams", + "description": "Stop filesystem watch notifications for a prior `fs/watch`.", + "type": "object", + "required": [ + "watchId" + ], + "properties": { + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "SkillsConfigWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteParams", + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "description": "Name-based selector.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Path-based selector.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + } + } + }, + "PluginInstallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginUninstallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallParams", + "type": "object", + "required": [ + "pluginId" + ], + "properties": { + "pluginId": { + "type": "string" + } + } + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "type": "object", + "required": [ + "mode", + "settings" + ], + "properties": { + "mode": { + "$ref": "#/definitions/ModeKind" + }, + "settings": { + "$ref": "#/definitions/Settings" + } + } + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "type": "string", + "enum": [ + "plan", + "default" + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "type": "object", + "required": [ + "model" + ], + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + } + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "TurnStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartParams", + "type": "object", + "required": [ + "input", + "threadId" + ], + "properties": { + "approvalPolicy": { + "description": "Override the approval policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "description": "Override the service tier for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Override the working directory for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "effort": { + "description": "Override the reasoning effort for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "model": { + "description": "Override the model for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "outputSchema": { + "description": "Optional JSON Schema used to constrain the final assistant message for this turn." + }, + "summary": { + "description": "Override the reasoning summary for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "personality": { + "description": "Override the personality for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "sandboxPolicy": { + "description": "Override the sandbox policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + } + } + }, + "TurnSteerParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerParams", + "type": "object", + "required": [ + "expectedTurnId", + "input", + "threadId" + ], + "properties": { + "expectedTurnId": { + "description": "Required active turn id precondition. The request fails when it does not match the currently active turn.", + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "threadId": { + "type": "string" + } + } + }, + "TurnInterruptParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptParams", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RealtimeOutputModality": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "RealtimeVoice": { + "type": "string", + "enum": [ + "alloy", + "arbor", + "ash", + "ballad", + "breeze", + "cedar", + "coral", + "cove", + "echo", + "ember", + "juniper", + "maple", + "marin", + "sage", + "shimmer", + "sol", + "spruce", + "vale", + "verse" + ] + }, + "ThreadRealtimeStartTransport": { + "description": "EXPERIMENTAL - transport used by thread realtime.", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "websocket" + ], + "title": "WebsocketThreadRealtimeStartTransportType" + } + }, + "title": "WebsocketThreadRealtimeStartTransport" + }, + { + "type": "object", + "required": [ + "sdp", + "type" + ], + "properties": { + "sdp": { + "description": "SDP offer generated by a WebRTC RTCPeerConnection after configuring audio and the realtime events data channel.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webrtc" + ], + "title": "WebrtcThreadRealtimeStartTransportType" + } + }, + "title": "WebrtcThreadRealtimeStartTransport" + } + ] + }, + "ThreadRealtimeItemAddedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeItemAddedNotification", + "description": "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + "type": "object", + "required": [ + "item", + "threadId" + ], + "properties": { + "item": true, + "threadId": { + "type": "string" + } + } + }, + "ThreadRealtimeAudioChunk": { + "description": "EXPERIMENTAL - thread realtime audio chunk.", + "type": "object", + "required": [ + "data", + "numChannels", + "sampleRate" + ], + "properties": { + "data": { + "type": "string" + }, + "itemId": { + "type": [ + "string", + "null" + ] + }, + "numChannels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sampleRate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samplesPerChannel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ThreadRealtimeStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeStartedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime startup is accepted.", + "type": "object", + "required": [ + "threadId", + "version" + ], + "properties": { + "realtimeSessionId": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/RealtimeConversationVersion" + } + } + }, + "RealtimeConversationVersion": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + }, + "ConfigWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWarningNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance or error details.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Optional path to the config file that triggered the warning.", + "type": [ + "string", + "null" + ] + }, + "range": { + "description": "Optional range for the error location inside the config file.", + "anyOf": [ + { + "$ref": "#/definitions/TextRange" + }, + { + "type": "null" + } + ] + }, + "summary": { + "description": "Concise summary of the warning.", + "type": "string" + } + } + }, + "TextRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "$ref": "#/definitions/TextPosition" + }, + "start": { + "$ref": "#/definitions/TextPosition" + } + } + }, + "ReviewDelivery": { + "type": "string", + "enum": [ + "inline", + "detached" + ] + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "uncommittedChanges" + ], + "title": "UncommittedChangesReviewTargetType" + } + }, + "title": "UncommittedChangesReviewTarget" + }, + { + "description": "Review changes between the current branch and the given base branch.", + "type": "object", + "required": [ + "branch", + "type" + ], + "properties": { + "branch": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "baseBranch" + ], + "title": "BaseBranchReviewTargetType" + } + }, + "title": "BaseBranchReviewTarget" + }, + { + "description": "Review the changes introduced by a specific commit.", + "type": "object", + "required": [ + "sha", + "type" + ], + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "commit" + ], + "title": "CommitReviewTargetType" + } + }, + "title": "CommitReviewTarget" + }, + { + "description": "Arbitrary instructions, equivalent to the old free-form prompt.", + "type": "object", + "required": [ + "instructions", + "type" + ], + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ], + "title": "CustomReviewTargetType" + } + }, + "title": "CustomReviewTarget" + } + ] + }, + "ReviewStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartParams", + "type": "object", + "required": [ + "target", + "threadId" + ], + "properties": { + "delivery": { + "description": "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ReviewDelivery" + }, + { + "type": "null" + } + ] + }, + "target": { + "$ref": "#/definitions/ReviewTarget" + }, + "threadId": { + "type": "string" + } + } + }, + "ModelListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "includeHidden": { + "description": "When true, include models that are hidden from the default picker list.", + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "ModelProviderCapabilitiesReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadParams", + "type": "object" + }, + "ExperimentalFeatureListParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", + "type": [ + "string", + "null" + ] + } + } + }, + "ExperimentalFeatureEnablementSetParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetParams", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "TextPosition": { + "type": "object", + "required": [ + "column", + "line" + ], + "properties": { + "column": { + "description": "1-based column number (in Unicode scalar values).", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "line": { + "description": "1-based line number.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "DeprecationNoticeNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DeprecationNoticeNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + } + } + }, + "GuardianWarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GuardianWarningNotification", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "description": "Concise guardian warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Thread target for the guardian warning.", + "type": "string" + } + } + }, + "McpServerOauthLoginParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginParams", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "timeoutSecs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "McpServerStatusDetail": { + "type": "string", + "enum": [ + "full", + "toolsAndAuthOnly" + ] + }, + "ListMcpServerStatusParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "detail": { + "description": "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", + "anyOf": [ + { + "$ref": "#/definitions/McpServerStatusDetail" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a server-defined value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + }, + "McpResourceReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadParams", + "type": "object", + "required": [ + "server", + "uri" + ], + "properties": { + "server": { + "type": "string" + }, + "threadId": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "McpServerToolCallParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallParams", + "type": "object", + "required": [ + "server", + "threadId", + "tool" + ], + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + } + }, + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + }, + "WindowsSandboxSetupStartParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartParams", + "type": "object", + "required": [ + "mode" + ], + "properties": { + "cwd": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + } + } + }, + "LoginAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountParams", + "oneOf": [ + { + "type": "object", + "required": [ + "apiKey", + "type" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountParamsType" + } + }, + "title": "ApiKeyv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "codexStreamlinedLogin": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountParamsType" + } + }, + "title": "Chatgptv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountParamsType" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountParams" + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId", + "type" + ], + "properties": { + "accessToken": { + "description": "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", + "type": "string" + }, + "chatgptAccountId": { + "description": "Workspace/account identifier supplied by the client.", + "type": "string" + }, + "chatgptPlanType": { + "description": "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountParamsType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountParams" + } + ] + }, + "CancelLoginAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountParams", + "type": "object", + "required": [ + "loginId" + ], + "properties": { + "loginId": { + "type": "string" + } + } + }, + "AddCreditsNudgeCreditType": { + "type": "string", + "enum": [ + "credits", + "usage_limit" + ] + }, + "SendAddCreditsNudgeEmailParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailParams", + "type": "object", + "required": [ + "creditType" + ], + "properties": { + "creditType": { + "$ref": "#/definitions/AddCreditsNudgeCreditType" + } + } + }, + "FeedbackUploadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadParams", + "type": "object", + "required": [ + "classification", + "includeLogs" + ], + "properties": { + "classification": { + "type": "string" + }, + "extraLogFiles": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeLogs": { + "type": "boolean" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "tags": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "threadId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "CommandExecTerminalSize": { + "description": "PTY size in character cells for `command/exec` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "CommandExecParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecParams", + "description": "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", + "type": "object", + "required": [ + "command" + ], + "properties": { + "command": { + "description": "Command argv vector. Empty arrays are rejected.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "Optional working directory. Defaults to the server cwd.", + "type": [ + "string", + "null" + ] + }, + "disableOutputCap": { + "description": "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + "type": "boolean" + }, + "disableTimeout": { + "description": "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + "type": "boolean" + }, + "env": { + "description": "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": [ + "string", + "null" + ] + } + }, + "outputBytesCap": { + "description": "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "tty": { + "description": "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + "type": "boolean" + }, + "processId": { + "description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + "type": [ + "string", + "null" + ] + }, + "sandboxPolicy": { + "description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + }, + "size": { + "description": "Optional initial PTY size in character cells. Only valid when `tty` is true.", + "anyOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + }, + { + "type": "null" + } + ] + }, + "streamStdin": { + "description": "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + "type": "boolean" + }, + "streamStdoutStderr": { + "description": "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + "type": "boolean" + }, + "timeoutMs": { + "description": "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "CommandExecWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteParams", + "description": "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "closeStdin": { + "description": "Close stdin after writing `deltaBase64`, if present.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Optional base64-encoded stdin bytes to write.", + "type": [ + "string", + "null" + ] + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandExecTerminateParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateParams", + "description": "Terminate a running `command/exec` session.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } + }, + "CommandExecResizeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeParams", + "description": "Resize a running PTY-backed `command/exec` session.", + "type": "object", + "required": [ + "processId", + "size" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "size": { + "description": "New PTY size in character cells.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + } + ] + } + } + }, + "ProcessTerminalSize": { + "description": "PTY size in character cells for `process/spawn` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "WarningNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WarningNotification", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "Concise warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Optional thread target when the warning applies to a specific thread.", + "type": [ + "string", + "null" + ] + } + } + }, + "ModelVerificationNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelVerificationNotification", + "type": "object", + "required": [ + "threadId", + "turnId", + "verifications" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "verifications": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVerification" + } + } + } + }, + "ModelVerification": { + "type": "string", + "enum": [ + "trustedAccessForCyber" + ] + }, + "ModelReroutedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelReroutedNotification", + "type": "object", + "required": [ + "fromModel", + "reason", + "threadId", + "toModel", + "turnId" + ], + "properties": { + "fromModel": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/ModelRerouteReason" + }, + "threadId": { + "type": "string" + }, + "toModel": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ConfigReadParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadParams", + "type": "object", + "properties": { + "cwd": { + "description": "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", + "type": [ + "string", + "null" + ] + }, + "includeLayers": { + "default": false, + "type": "boolean" + } + } + }, + "ExternalAgentConfigDetectParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectParams", + "type": "object", + "properties": { + "cwds": { + "description": "Zero or more working directories to include for repo-scoped detection.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeHome": { + "description": "If true, include detection under the user's home (~/.claude, ~/.codex, etc.).", + "type": "boolean" + } + } + }, + "CommandMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigMigrationItem": { + "type": "object", + "required": [ + "description", + "itemType" + ], + "properties": { + "cwd": { + "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "$ref": "#/definitions/MigrationDetails" + }, + { + "type": "null" + } + ] + }, + "itemType": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItemType" + } + } + }, + "ExternalAgentConfigMigrationItemType": { + "type": "string", + "enum": [ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "SESSIONS" + ] + }, + "HookMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "McpServerMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "MigrationDetails": { + "type": "object", + "properties": { + "commands": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/CommandMigration" + } + }, + "hooks": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/HookMigration" + } + }, + "mcpServers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/McpServerMigration" + } + }, + "plugins": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PluginsMigration" + } + }, + "sessions": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SessionMigration" + } + }, + "subagents": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SubagentMigration" + } + } + } + }, + "PluginsMigration": { + "type": "object", + "required": [ + "marketplaceName", + "pluginNames" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "pluginNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SessionMigration": { + "type": "object", + "required": [ + "cwd", + "path" + ], + "properties": { + "cwd": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "SubagentMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigImportParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportParams", + "type": "object", + "required": [ + "migrationItems" + ], + "properties": { + "migrationItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItem" + } + } + } + }, + "MergeStrategy": { + "type": "string", + "enum": [ + "replace", + "upsert" + ] + }, + "ConfigValueWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigValueWriteParams", + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + } + }, + "ConfigEdit": { + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + } + }, + "ConfigBatchWriteParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigBatchWriteParams", + "type": "object", + "required": [ + "edits" + ], + "properties": { + "edits": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigEdit" + } + }, + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "reloadUserConfig": { + "description": "When true, hot-reload the updated user config into all loaded threads after writing.", + "type": "boolean" + } + } + }, + "GetAccountParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountParams", + "type": "object", + "properties": { + "refreshToken": { + "description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + "default": false, + "type": "boolean" + } + } + }, + "AgentPath": { + "type": "string" + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + }, + "ThreadStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + } + }, + "ThreadResumeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + } + }, + "ThreadForkResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "thread": { + "$ref": "#/definitions/Thread" + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + } + }, + "ThreadArchiveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveResponse", + "type": "object" + }, + "ThreadUnsubscribeStatus": { + "type": "string", + "enum": [ + "notLoaded", + "notSubscribed", + "unsubscribed" + ] + }, + "ThreadUnsubscribeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/ThreadUnsubscribeStatus" + } + } + }, + "ModelRerouteReason": { + "type": "string", + "enum": [ + "highRiskCyberActivity" + ] + }, + "ContextCompactedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContextCompactedNotification", + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ThreadSetNameResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameResponse", + "type": "object" + }, + "ThreadGoal": { + "type": "object", + "required": [ + "createdAt", + "objective", + "status", + "threadId", + "timeUsedSeconds", + "tokensUsed", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "objective": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/ThreadGoalStatus" + }, + "threadId": { + "type": "string" + }, + "timeUsedSeconds": { + "type": "integer", + "format": "int64" + }, + "tokenBudget": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "tokensUsed": { + "type": "integer", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "format": "int64" + } + } + }, + "ReasoningTextDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningTextDeltaNotification", + "type": "object", + "required": [ + "contentIndex", + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "contentIndex": { + "type": "integer", + "format": "int64" + }, + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningSummaryPartAddedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryPartAddedNotification", + "type": "object", + "required": [ + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ReasoningSummaryTextDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryTextDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ThreadMetadataUpdateResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + } + }, + "FsChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsChangedNotification", + "description": "Filesystem watch notification emitted for `fs/watch` subscribers.", + "type": "object", + "required": [ + "changedPaths", + "watchId" + ], + "properties": { + "changedPaths": { + "description": "File or directory paths associated with this event.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } + }, + "ExternalAgentConfigImportCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportCompletedNotification", + "type": "object" + }, + "ThreadUnarchiveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + } + }, + "ThreadCompactStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartResponse", + "type": "object" + }, + "ThreadShellCommandResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandResponse", + "type": "object" + }, + "ThreadApproveGuardianDeniedActionResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionResponse", + "type": "object" + }, + "RemoteControlStatusChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RemoteControlStatusChangedNotification", + "description": "Current remote-control connection status and remote identity exposed to clients.", + "type": "object", + "required": [ + "installationId", + "serverName", + "status" + ], + "properties": { + "environmentId": { + "type": [ + "string", + "null" + ] + }, + "installationId": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/RemoteControlConnectionStatus" + } + } + }, + "ThreadRollbackResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "description": "The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`.", + "allOf": [ + { + "$ref": "#/definitions/Thread" + } + ] + } + } + }, + "ThreadListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "backwardsCursor": { + "description": "Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one thread. Use it with the opposite `sortDirection`; for timestamp sorts it anchors at the start of the page timestamp so same-second updates are not skipped.", + "type": [ + "string", + "null" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Thread" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadLoadedListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "description": "Thread ids for sessions currently loaded in memory.", + "type": "array", + "items": { + "type": "string" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + } + }, + "AppListUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppListUpdatedNotification", + "description": "EXPERIMENTAL - notification emitted when the app list changes.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AppInfo" + } + } + } + }, + "AccountRateLimitsUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountRateLimitsUpdatedNotification", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "$ref": "#/definitions/RateLimitSnapshot" + } + } + }, + "ThreadInjectItemsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsResponse", + "type": "object" + }, + "SkillDependencies": { + "type": "object", + "required": [ + "tools" + ], + "properties": { + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillToolDependency" + } + } + } + }, + "SkillErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "SkillInterface": { + "type": "object", + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "iconLarge": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "iconSmall": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "SkillMetadata": { + "type": "object", + "required": [ + "description", + "enabled", + "name", + "path", + "scope" + ], + "properties": { + "dependencies": { + "anyOf": [ + { + "$ref": "#/definitions/SkillDependencies" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "scope": { + "$ref": "#/definitions/SkillScope" + }, + "shortDescription": { + "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + "type": [ + "string", + "null" + ] + } + } + }, + "SkillScope": { + "type": "string", + "enum": [ + "user", + "repo", + "system", + "admin" + ] + }, + "SkillToolDependency": { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "transport": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "string" + } + } + }, + "SkillsListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "skills" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillErrorInfo" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillMetadata" + } + } + } + }, + "SkillsListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillsListEntry" + } + } + } + }, + "HookErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookMetadata": { + "type": "object", + "required": [ + "currentHash", + "displayOrder", + "enabled", + "eventName", + "handlerType", + "isManaged", + "key", + "source", + "sourcePath", + "timeoutSec", + "trustStatus" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "currentHash": { + "type": "string" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "enabled": { + "type": "boolean" + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "isManaged": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "matcher": { + "type": [ + "string", + "null" + ] + }, + "pluginId": { + "type": [ + "string", + "null" + ] + }, + "source": { + "$ref": "#/definitions/HookSource" + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "trustStatus": { + "$ref": "#/definitions/HookTrustStatus" + } + } + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + }, + "HookTrustStatus": { + "type": "string", + "enum": [ + "managed", + "untrusted", + "trusted", + "modified" + ] + }, + "HooksListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "hooks", + "warnings" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/HookErrorInfo" + } + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/HookMetadata" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "HooksListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/HooksListEntry" + } + } + } + }, + "MarketplaceAddResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddResponse", + "type": "object", + "required": [ + "alreadyAdded", + "installedRoot", + "marketplaceName" + ], + "properties": { + "alreadyAdded": { + "type": "boolean" + }, + "installedRoot": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceRemoveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveResponse", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "installedRoot": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "marketplaceName": { + "type": "string" + } + } + }, + "MarketplaceUpgradeErrorInfo": { + "type": "object", + "required": [ + "marketplaceName", + "message" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "MarketplaceUpgradeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeResponse", + "type": "object", + "required": [ + "errors", + "selectedMarketplaces", + "upgradedRoots" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceUpgradeErrorInfo" + } + }, + "selectedMarketplaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "upgradedRoots": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "MarketplaceInterface": { + "type": "object", + "properties": { + "displayName": { + "type": [ + "string", + "null" + ] + } + } + }, + "MarketplaceLoadErrorInfo": { + "type": "object", + "required": [ + "marketplacePath", + "message" + ], + "properties": { + "marketplacePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "message": { + "type": "string" + } + } + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginMarketplaceEntry": { + "type": "object", + "required": [ + "name", + "plugins" + ], + "properties": { + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/MarketplaceInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "description": "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugins": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginSummary" + } + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/PluginSource" + } + } + }, + "PluginListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "featuredPluginIds": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginMarketplaceEntry" + } + } + } + }, + "PluginInstalledResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginMarketplaceEntry" + } + } + } + }, + "AppSummary": { + "description": "EXPERIMENTAL - app metadata summary for plugin responses.", + "type": "object", + "required": [ + "id", + "name", + "needsAuth" + ], + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "needsAuth": { + "type": "boolean" + } + } + }, + "PluginDetail": { + "type": "object", + "required": [ + "apps", + "hooks", + "marketplaceName", + "mcpServers", + "skills", + "summary" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/AppSummary" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginHookSummary" + } + }, + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mcpServers": { + "type": "array", + "items": { + "type": "string" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillSummary" + } + }, + "summary": { + "$ref": "#/definitions/PluginSummary" + } + } + }, + "PluginHookSummary": { + "type": "object", + "required": [ + "eventName", + "key" + ], + "properties": { + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "key": { + "type": "string" + } + } + }, + "SkillSummary": { + "type": "object", + "required": [ + "description", + "enabled", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadResponse", + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "plugin": { + "$ref": "#/definitions/PluginDetail" + } + } + }, + "PluginSkillReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadResponse", + "type": "object", + "properties": { + "contents": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareSaveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveResponse", + "type": "object", + "required": [ + "remotePluginId", + "shareUrl" + ], + "properties": { + "remotePluginId": { + "type": "string" + }, + "shareUrl": { + "type": "string" + } + } + }, + "PluginShareUpdateTargetsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsResponse", + "type": "object", + "required": [ + "discoverability", + "principals" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + "principals": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + } + } + }, + "PluginShareListItem": { + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "localPluginPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugin": { + "$ref": "#/definitions/PluginSummary" + } + } + }, + "PluginShareListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginShareListItem" + } + } + } + }, + "PluginShareCheckoutResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutResponse", + "type": "object", + "required": [ + "marketplaceName", + "marketplacePath", + "pluginId", + "pluginName", + "pluginPath", + "remotePluginId" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "pluginId": { + "type": "string" + }, + "pluginName": { + "type": "string" + }, + "pluginPath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDeleteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteResponse", + "type": "object" + }, + "AppBranding": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "isDiscoverableApp" + ], + "properties": { + "category": { + "type": [ + "string", + "null" + ] + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "isDiscoverableApp": { + "type": "boolean" + }, + "privacyPolicy": { + "type": [ + "string", + "null" + ] + }, + "termsOfService": { + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppInfo": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "appMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/AppMetadata" + }, + { + "type": "null" + } + ] + }, + "branding": { + "anyOf": [ + { + "$ref": "#/definitions/AppBranding" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "distributionChannel": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "isAccessible": { + "default": false, + "type": "boolean" + }, + "isEnabled": { + "description": "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + "default": true, + "type": "boolean" + }, + "labels": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "logoUrl": { + "type": [ + "string", + "null" + ] + }, + "logoUrlDark": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "pluginDisplayNames": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AppMetadata": { + "type": "object", + "properties": { + "categories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "firstPartyRequiresInstall": { + "type": [ + "boolean", + "null" + ] + }, + "firstPartyType": { + "type": [ + "string", + "null" + ] + }, + "review": { + "anyOf": [ + { + "$ref": "#/definitions/AppReview" + }, + { + "type": "null" + } + ] + }, + "screenshots": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AppScreenshot" + } + }, + "seoDescription": { + "type": [ + "string", + "null" + ] + }, + "showInComposerWhenUnlinked": { + "type": [ + "boolean", + "null" + ] + }, + "subCategories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "version": { + "type": [ + "string", + "null" + ] + }, + "versionId": { + "type": [ + "string", + "null" + ] + }, + "versionNotes": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppReview": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string" + } + } + }, + "AppScreenshot": { + "type": "object", + "required": [ + "userPrompt" + ], + "properties": { + "fileId": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "userPrompt": { + "type": "string" + } + } + }, + "AppsListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListResponse", + "description": "EXPERIMENTAL - app list response.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AppInfo" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "FsReadFileResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileResponse", + "description": "Base64-encoded file contents returned by `fs/readFile`.", + "type": "object", + "required": [ + "dataBase64" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + } + } + }, + "FsWriteFileResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileResponse", + "description": "Successful response for `fs/writeFile`.", + "type": "object" + }, + "FsCreateDirectoryResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryResponse", + "description": "Successful response for `fs/createDirectory`.", + "type": "object" + }, + "FsGetMetadataResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataResponse", + "description": "Metadata returned by `fs/getMetadata`.", + "type": "object", + "required": [ + "createdAtMs", + "isDirectory", + "isFile", + "isSymlink", + "modifiedAtMs" + ], + "properties": { + "createdAtMs": { + "description": "File creation time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + }, + "isDirectory": { + "description": "Whether the path resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether the path resolves to a regular file.", + "type": "boolean" + }, + "isSymlink": { + "description": "Whether the path itself is a symbolic link.", + "type": "boolean" + }, + "modifiedAtMs": { + "description": "File modification time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + } + } + }, + "FsReadDirectoryEntry": { + "description": "A directory entry returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "fileName", + "isDirectory", + "isFile" + ], + "properties": { + "fileName": { + "description": "Direct child entry name only, not an absolute or relative path.", + "type": "string" + }, + "isDirectory": { + "description": "Whether this entry resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether this entry resolves to a regular file.", + "type": "boolean" + } + } + }, + "FsReadDirectoryResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryResponse", + "description": "Directory entries returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "entries" + ], + "properties": { + "entries": { + "description": "Direct child entries in the requested directory.", + "type": "array", + "items": { + "$ref": "#/definitions/FsReadDirectoryEntry" + } + } + } + }, + "FsRemoveResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveResponse", + "description": "Successful response for `fs/remove`.", + "type": "object" + }, + "FsCopyResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyResponse", + "description": "Successful response for `fs/copy`.", + "type": "object" + }, + "FsWatchResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchResponse", + "description": "Successful response for `fs/watch`.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Canonicalized path associated with the watch.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + } + }, + "FsUnwatchResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchResponse", + "description": "Successful response for `fs/unwatch`.", + "type": "object" + }, + "SkillsConfigWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteResponse", + "type": "object", + "required": [ + "effectiveEnabled" + ], + "properties": { + "effectiveEnabled": { + "type": "boolean" + } + } + }, + "PluginInstallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallResponse", + "type": "object", + "required": [ + "appsNeedingAuth", + "authPolicy" + ], + "properties": { + "appsNeedingAuth": { + "type": "array", + "items": { + "$ref": "#/definitions/AppSummary" + } + }, + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + } + } + }, + "PluginUninstallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallResponse", + "type": "object" + }, + "TurnStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartResponse", + "type": "object", + "required": [ + "turn" + ], + "properties": { + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "TurnSteerResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerResponse", + "type": "object", + "required": [ + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + } + } + }, + "TurnInterruptResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptResponse", + "type": "object" + }, + "AccountUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountUpdatedNotification", + "type": "object", + "properties": { + "authMode": { + "anyOf": [ + { + "$ref": "#/definitions/AuthMode" + }, + { + "type": "null" + } + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + } + } + }, + "AuthMode": { + "description": "Authentication mode for OpenAI-backed providers.", + "oneOf": [ + { + "description": "OpenAI API key provided by the caller and stored by Codex.", + "type": "string", + "enum": [ + "apikey" + ] + }, + { + "description": "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + "type": "string", + "enum": [ + "chatgpt" + ] + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + "type": "string", + "enum": [ + "chatgptAuthTokens" + ] + }, + { + "description": "Programmatic Codex auth backed by a registered Agent Identity.", + "type": "string", + "enum": [ + "agentIdentity" + ] + } + ] + }, + "McpServerStatusUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerStatusUpdatedNotification", + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpServerStartupState" + } + } + }, + "McpServerStartupState": { + "type": "string", + "enum": [ + "starting", + "ready", + "failed", + "cancelled" + ] + }, + "RealtimeVoicesList": { + "type": "object", + "required": [ + "defaultV1", + "defaultV2", + "v1", + "v2" + ], + "properties": { + "defaultV1": { + "$ref": "#/definitions/RealtimeVoice" + }, + "defaultV2": { + "$ref": "#/definitions/RealtimeVoice" + }, + "v1": { + "type": "array", + "items": { + "$ref": "#/definitions/RealtimeVoice" + } + }, + "v2": { + "type": "array", + "items": { + "$ref": "#/definitions/RealtimeVoice" + } + } + } + }, + "McpServerOauthLoginCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginCompletedNotification", + "type": "object", + "required": [ + "name", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } + }, + "ReviewStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartResponse", + "type": "object", + "required": [ + "reviewThreadId", + "turn" + ], + "properties": { + "reviewThreadId": { + "description": "Identifies the thread where the review runs.\n\nFor inline reviews, this is the original thread id. For detached reviews, this is the id of the new review thread.", + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "InputModality": { + "description": "Canonical user-input modality tags advertised by a model.", + "oneOf": [ + { + "description": "Plain text turns and tool payloads.", + "type": "string", + "enum": [ + "text" + ] + }, + { + "description": "Image attachments included in user turns.", + "type": "string", + "enum": [ + "image" + ] + } + ] + }, + "Model": { + "type": "object", + "required": [ + "defaultReasoningEffort", + "description", + "displayName", + "hidden", + "id", + "isDefault", + "model", + "supportedReasoningEfforts" + ], + "properties": { + "additionalSpeedTiers": { + "description": "Deprecated: use `serviceTiers` instead.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "availabilityNux": { + "anyOf": [ + { + "$ref": "#/definitions/ModelAvailabilityNux" + }, + { + "type": "null" + } + ] + }, + "defaultReasoningEffort": { + "$ref": "#/definitions/ReasoningEffort" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "inputModalities": { + "default": [ + "text", + "image" + ], + "type": "array", + "items": { + "$ref": "#/definitions/InputModality" + } + }, + "isDefault": { + "type": "boolean" + }, + "model": { + "type": "string" + }, + "serviceTiers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/ModelServiceTier" + } + }, + "supportedReasoningEfforts": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningEffortOption" + } + }, + "supportsPersonality": { + "default": false, + "type": "boolean" + }, + "upgrade": { + "type": [ + "string", + "null" + ] + }, + "upgradeInfo": { + "anyOf": [ + { + "$ref": "#/definitions/ModelUpgradeInfo" + }, + { + "type": "null" + } + ] + } + } + }, + "ModelAvailabilityNux": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "ModelServiceTier": { + "type": "object", + "required": [ + "description", + "id", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ModelUpgradeInfo": { + "type": "object", + "required": [ + "model" + ], + "properties": { + "migrationMarkdown": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "modelLink": { + "type": [ + "string", + "null" + ] + }, + "upgradeCopy": { + "type": [ + "string", + "null" + ] + } + } + }, + "ReasoningEffortOption": { + "type": "object", + "required": [ + "description", + "reasoningEffort" + ], + "properties": { + "description": { + "type": "string" + }, + "reasoningEffort": { + "$ref": "#/definitions/ReasoningEffort" + } + } + }, + "ModelListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Model" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ModelProviderCapabilitiesReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadResponse", + "type": "object", + "required": [ + "imageGeneration", + "namespaceTools", + "webSearch" + ], + "properties": { + "imageGeneration": { + "type": "boolean" + }, + "namespaceTools": { + "type": "boolean" + }, + "webSearch": { + "type": "boolean" + } + } + }, + "ExperimentalFeature": { + "type": "object", + "required": [ + "defaultEnabled", + "enabled", + "name", + "stage" + ], + "properties": { + "announcement": { + "description": "Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "defaultEnabled": { + "description": "Whether this feature is enabled by default.", + "type": "boolean" + }, + "description": { + "description": "Short summary describing what the feature does. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "displayName": { + "description": "User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "enabled": { + "description": "Whether this feature is currently enabled in the loaded config.", + "type": "boolean" + }, + "name": { + "description": "Stable key used in config.toml and CLI flag toggles.", + "type": "string" + }, + "stage": { + "description": "Lifecycle stage of this feature flag.", + "allOf": [ + { + "$ref": "#/definitions/ExperimentalFeatureStage" + } + ] + } + } + }, + "ExperimentalFeatureStage": { + "oneOf": [ + { + "description": "Feature is available for user testing and feedback.", + "type": "string", + "enum": [ + "beta" + ] + }, + { + "description": "Feature is still being built and not ready for broad use.", + "type": "string", + "enum": [ + "underDevelopment" + ] + }, + { + "description": "Feature is production-ready.", + "type": "string", + "enum": [ + "stable" + ] + }, + { + "description": "Feature is deprecated and should be avoided.", + "type": "string", + "enum": [ + "deprecated" + ] + }, + { + "description": "Feature flag is retained only for backwards compatibility.", + "type": "string", + "enum": [ + "removed" + ] + } + ] + }, + "ExperimentalFeatureListResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/ExperimentalFeature" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ExperimentalFeatureEnablementSetResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetResponse", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Feature enablement entries updated by this request.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } + }, + "RemoteControlConnectionStatus": { + "type": "string", + "enum": [ + "disabled", + "connecting", + "connected", + "errored" + ] + }, + "McpToolCallProgressNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpToolCallProgressNotification", + "type": "object", + "required": [ + "itemId", + "message", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ServerRequestResolvedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerRequestResolvedNotification", + "type": "object", + "required": [ + "requestId", + "threadId" + ], + "properties": { + "requestId": { + "$ref": "#/definitions/RequestId" + }, + "threadId": { + "type": "string" + } + } + }, + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + }, + "CollaborationModeMask": { + "description": "EXPERIMENTAL - collaboration mode preset metadata for clients.", + "type": "object", + "required": [ + "name" + ], + "properties": { + "mode": { + "anyOf": [ + { + "$ref": "#/definitions/ModeKind" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + { + "type": "null" + } + ] + } + } + }, + "FileChangePatchUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangePatchUpdatedNotification", + "type": "object", + "required": [ + "changes", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "FileChangeOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeOutputDeltaNotification", + "description": "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TerminalInteractionNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TerminalInteractionNotification", + "type": "object", + "required": [ + "itemId", + "processId", + "stdin", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "processId": { + "type": "string" + }, + "stdin": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "McpServerOauthLoginResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginResponse", + "type": "object", + "required": [ + "authorizationUrl" + ], + "properties": { + "authorizationUrl": { + "type": "string" + } + } + }, + "McpServerRefreshResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerRefreshResponse", + "type": "object" + }, + "McpAuthStatus": { + "type": "string", + "enum": [ + "unsupported", + "notLoggedIn", + "bearerToken", + "oAuth" + ] + }, + "McpServerStatus": { + "type": "object", + "required": [ + "authStatus", + "name", + "resourceTemplates", + "resources", + "tools" + ], + "properties": { + "authStatus": { + "$ref": "#/definitions/McpAuthStatus" + }, + "name": { + "type": "string" + }, + "resourceTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceTemplate" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "tools": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Tool" + } + } + } + }, + "Resource": { + "description": "A known resource that the server is capable of reading.", + "type": "object", + "required": [ + "name", + "uri" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "ResourceTemplate": { + "description": "A template description for resources available on the server.", + "type": "object", + "required": [ + "name", + "uriTemplate" + ], + "properties": { + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uriTemplate": { + "type": "string" + } + } + }, + "Tool": { + "description": "Definition for a tool the client can call.", + "type": "object", + "required": [ + "inputSchema", + "name" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "outputSchema": true, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "ListMcpServerStatusResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/McpServerStatus" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } + }, + "ResourceContent": { + "description": "Contents returned when reading a resource from an MCP server.", + "anyOf": [ + { + "type": "object", + "required": [ + "text", + "uri" + ], + "properties": { + "_meta": true, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": "string" + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "blob", + "uri" + ], + "properties": { + "_meta": true, + "blob": { + "type": "string" + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + } + ] + }, + "McpResourceReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadResponse", + "type": "object", + "required": [ + "contents" + ], + "properties": { + "contents": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceContent" + } + } + } + }, + "McpServerToolCallResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallResponse", + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + } + }, + "WindowsSandboxSetupStartResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartResponse", + "type": "object", + "required": [ + "started" + ], + "properties": { + "started": { + "type": "boolean" + } + } + }, + "WindowsSandboxReadiness": { + "type": "string", + "enum": [ + "ready", + "notConfigured", + "updateRequired" + ] + }, + "WindowsSandboxReadinessResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxReadinessResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/WindowsSandboxReadiness" + } + } + }, + "LoginAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountResponse", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountResponseType" + } + }, + "title": "ApiKeyv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "authUrl", + "loginId", + "type" + ], + "properties": { + "authUrl": { + "description": "URL the client should open in a browser to initiate the OAuth flow.", + "type": "string" + }, + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountResponseType" + } + }, + "title": "Chatgptv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "loginId", + "type", + "userCode", + "verificationUrl" + ], + "properties": { + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountResponseType" + }, + "userCode": { + "description": "One-time code the user must enter after signing in.", + "type": "string" + }, + "verificationUrl": { + "description": "URL the client should open in a browser to complete device code authorization.", + "type": "string" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountResponseType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountResponse" + } + ] + }, + "CancelLoginAccountStatus": { + "type": "string", + "enum": [ + "canceled", + "notFound" + ] + }, + "CancelLoginAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/CancelLoginAccountStatus" + } + } + }, + "LogoutAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LogoutAccountResponse", + "type": "object" + }, + "CreditsSnapshot": { + "type": "object", + "required": [ + "hasCredits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "hasCredits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + }, + "RateLimitReachedType": { + "type": "string", + "enum": [ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limitId": { + "type": [ + "string", + "null" + ] + }, + "limitName": { + "type": [ + "string", + "null" + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "rateLimitReachedType": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitReachedType" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "usedPercent" + ], + "properties": { + "resetsAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "usedPercent": { + "type": "integer", + "format": "int32" + }, + "windowDurationMins": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + }, + "GetAccountRateLimitsResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountRateLimitsResponse", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "description": "Backward-compatible single-bucket view; mirrors the historical payload.", + "allOf": [ + { + "$ref": "#/definitions/RateLimitSnapshot" + } + ] + }, + "rateLimitsByLimitId": { + "description": "Multi-bucket view keyed by metered `limit_id` (for example, `codex`).", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/RateLimitSnapshot" + } + } + } + }, + "AddCreditsNudgeEmailStatus": { + "type": "string", + "enum": [ + "sent", + "cooldown_active" + ] + }, + "SendAddCreditsNudgeEmailResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/AddCreditsNudgeEmailStatus" + } + } + }, + "FeedbackUploadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadResponse", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "CommandExecResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResponse", + "description": "Final buffered result for `command/exec`.", + "type": "object", + "required": [ + "exitCode", + "stderr", + "stdout" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `command/exec/outputDelta`.", + "type": "string" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `command/exec/outputDelta`.", + "type": "string" + } + } + }, + "CommandExecWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteResponse", + "description": "Empty success response for `command/exec/write`.", + "type": "object" + }, + "CommandExecTerminateResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateResponse", + "description": "Empty success response for `command/exec/terminate`.", + "type": "object" + }, + "CommandExecResizeResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeResponse", + "description": "Empty success response for `command/exec/resize`.", + "type": "object" + }, + "CommandExecutionOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionOutputDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ProcessExitedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessExitedNotification", + "description": "Final process exit notification for `process/spawn`.", + "type": "object", + "required": [ + "exitCode", + "processHandle", + "stderr", + "stderrCapReached", + "stdout", + "stdoutCapReached" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `process/outputDelta`.", + "type": "string" + }, + "stderrCapReached": { + "description": "Whether stderr reached `outputBytesCap`.\n\nIn streaming mode, stderr is empty and cap state is also reported on the final stderr `process/outputDelta` notification.", + "type": "boolean" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `process/outputDelta`.", + "type": "string" + }, + "stdoutCapReached": { + "description": "Whether stdout reached `outputBytesCap`.\n\nIn streaming mode, stdout is empty and cap state is also reported on the final stdout `process/outputDelta` notification.", + "type": "boolean" + } + } + }, + "ProcessOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processHandle", + "stream" + ], + "properties": { + "capReached": { + "description": "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stream": { + "description": "Output stream this chunk belongs to.", + "allOf": [ + { + "$ref": "#/definitions/ProcessOutputStream" + } + ] + } + } + }, + "ProcessOutputStream": { + "description": "Stream label for `process/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "AnalyticsConfig": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": true + }, + "AppConfig": { + "type": "object", + "properties": { + "default_tools_approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "default_tools_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "destructive_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolsConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppToolApproval": { + "type": "string", + "enum": [ + "auto", + "prompt", + "approve" + ] + }, + "AppToolConfig": { + "type": "object", + "properties": { + "approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AppToolsConfig": { + "type": "object" + }, + "AppsConfig": { + "type": "object", + "properties": { + "_default": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AppsDefaultConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppsDefaultConfig": { + "type": "object", + "properties": { + "destructive_enabled": { + "default": true, + "type": "boolean" + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "default": true, + "type": "boolean" + } + } + }, + "Config": { + "type": "object", + "properties": { + "analytics": { + "anyOf": [ + { + "$ref": "#/definitions/AnalyticsConfig" + }, + { + "type": "null" + } + ] + }, + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional default for where approval requests are routed for review.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchMode" + }, + { + "type": "null" + } + ] + }, + "compact_prompt": { + "type": [ + "string", + "null" + ] + }, + "desktop": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "forced_chatgpt_workspace_id": { + "anyOf": [ + { + "$ref": "#/definitions/ForcedChatgptWorkspaceIds" + }, + { + "type": "null" + } + ] + }, + "forced_login_method": { + "anyOf": [ + { + "$ref": "#/definitions/ForcedLoginMethod" + }, + { + "type": "null" + } + ] + }, + "instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_auto_compact_token_limit": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_context_window": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/Verbosity" + }, + { + "type": "null" + } + ] + }, + "profile": { + "type": [ + "string", + "null" + ] + }, + "profiles": { + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProfileV2" + } + }, + "review_model": { + "type": [ + "string", + "null" + ] + }, + "sandbox_mode": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sandbox_workspace_write": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxWorkspaceWrite" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/ToolsV2" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "ConfigLayer": { + "type": "object", + "required": [ + "config", + "name", + "version" + ], + "properties": { + "config": true, + "disabledReason": { + "type": [ + "string", + "null" + ] + }, + "name": { + "$ref": "#/definitions/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerMetadata": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "$ref": "#/definitions/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerSource": { + "oneOf": [ + { + "description": "Managed preferences layer delivered by MDM (macOS only).", + "type": "object", + "required": [ + "domain", + "key", + "type" + ], + "properties": { + "domain": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mdm" + ], + "title": "MdmConfigLayerSourceType" + } + }, + "title": "MdmConfigLayerSource" + }, + { + "description": "Managed config layer from a file (usually `managed_config.toml`).", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the system config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "system" + ], + "title": "SystemConfigLayerSourceType" + } + }, + "title": "SystemConfigLayerSource" + }, + { + "description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "profile": { + "description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "user" + ], + "title": "UserConfigLayerSourceType" + } + }, + "title": "UserConfigLayerSource" + }, + { + "description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + "type": "object", + "required": [ + "dotCodexFolder", + "type" + ], + "properties": { + "dotCodexFolder": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "project" + ], + "title": "ProjectConfigLayerSourceType" + } + }, + "title": "ProjectConfigLayerSource" + }, + { + "description": "Session-layer overrides supplied via `-c`/`--config`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "sessionFlags" + ], + "title": "SessionFlagsConfigLayerSourceType" + } + }, + "title": "SessionFlagsConfigLayerSource" + }, + { + "description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromFile" + ], + "title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromFileConfigLayerSource" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromMdm" + ], + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSource" + } + ] + }, + "ForcedChatgptWorkspaceIds": { + "description": "Backward-compatible API shape for ChatGPT workspace login restrictions.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ForcedLoginMethod": { + "type": "string", + "enum": [ + "chatgpt", + "api" + ] + }, + "ProfileV2": { + "type": "object", + "properties": { + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional profile-level override for where approval requests are routed for review. If omitted, the enclosing config default is used.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "chatgpt_base_url": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/Verbosity" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/ToolsV2" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchMode" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "SandboxWorkspaceWrite": { + "type": "object", + "properties": { + "exclude_slash_tmp": { + "default": false, + "type": "boolean" + }, + "exclude_tmpdir_env_var": { + "default": false, + "type": "boolean" + }, + "network_access": { + "default": false, + "type": "boolean" + }, + "writable_roots": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ToolsV2": { + "type": "object", + "properties": { + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchToolConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "Verbosity": { + "description": "Controls output length/detail on GPT-5 models via the Responses API. Serialized with lowercase values to match the OpenAI API.", + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchContextSize": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchLocation": { + "type": "object", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "region": { + "type": [ + "string", + "null" + ] + }, + "timezone": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WebSearchMode": { + "type": "string", + "enum": [ + "disabled", + "cached", + "live" + ] + }, + "WebSearchToolConfig": { + "type": "object", + "properties": { + "allowed_domains": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "context_size": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchContextSize" + }, + { + "type": "null" + } + ] + }, + "location": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchLocation" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ConfigReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadResponse", + "type": "object", + "required": [ + "config", + "origins" + ], + "properties": { + "config": { + "$ref": "#/definitions/Config" + }, + "layers": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ConfigLayer" + } + }, + "origins": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ConfigLayerMetadata" + } + } + } + }, + "ExternalAgentConfigDetectResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectResponse", + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItem" + } + } + } + }, + "ExternalAgentConfigImportResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportResponse", + "type": "object" + }, + "OverriddenMetadata": { + "type": "object", + "required": [ + "effectiveValue", + "message", + "overridingLayer" + ], + "properties": { + "effectiveValue": true, + "message": { + "type": "string" + }, + "overridingLayer": { + "$ref": "#/definitions/ConfigLayerMetadata" + } + } + }, + "WriteStatus": { + "type": "string", + "enum": [ + "ok", + "okOverridden" + ] + }, + "ConfigWriteResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWriteResponse", + "type": "object", + "required": [ + "filePath", + "status", + "version" + ], + "properties": { + "filePath": { + "description": "Canonical path to the config file that was written.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "overriddenMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/OverriddenMetadata" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/WriteStatus" + }, + "version": { + "type": "string" + } + } + }, + "ConfigRequirements": { + "type": "object", + "properties": { + "allowManagedHooksOnly": { + "type": [ + "boolean", + "null" + ] + }, + "allowedApprovalPolicies": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AskForApproval" + } + }, + "featureRequirements": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "boolean" + } + }, + "allowedSandboxModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/SandboxMode" + } + }, + "allowedWebSearchModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/WebSearchMode" + } + }, + "enforceResidency": { + "anyOf": [ + { + "$ref": "#/definitions/ResidencyRequirement" + }, + { + "type": "null" + } + ] + } + } + }, + "ConfiguredHookHandler": { + "oneOf": [ + { + "type": "object", + "required": [ + "async", + "command", + "type" + ], + "properties": { + "async": { + "type": "boolean" + }, + "command": { + "type": "string" + }, + "commandWindows": { + "type": [ + "string", + "null" + ] + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandConfiguredHookHandlerType" + } + }, + "title": "CommandConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "prompt" + ], + "title": "PromptConfiguredHookHandlerType" + } + }, + "title": "PromptConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "agent" + ], + "title": "AgentConfiguredHookHandlerType" + } + }, + "title": "AgentConfiguredHookHandler" + } + ] + }, + "ConfiguredHookMatcherGroup": { + "type": "object", + "required": [ + "hooks" + ], + "properties": { + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookHandler" + } + }, + "matcher": { + "type": [ + "string", + "null" + ] + } + } + }, + "ManagedHooksRequirements": { + "type": "object", + "required": [ + "PermissionRequest", + "PostCompact", + "PostToolUse", + "PreCompact", + "PreToolUse", + "SessionStart", + "Stop", + "UserPromptSubmit" + ], + "properties": { + "PermissionRequest": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PostCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PostToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PreCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PreToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "SessionStart": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "Stop": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "UserPromptSubmit": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "managedDir": { + "type": [ + "string", + "null" + ] + }, + "windowsManagedDir": { + "type": [ + "string", + "null" + ] + } + } + }, + "NetworkDomainPermission": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "NetworkRequirements": { + "type": "object", + "properties": { + "allowLocalBinding": { + "type": [ + "boolean", + "null" + ] + }, + "allowUnixSockets": { + "description": "Legacy compatibility view derived from `unix_sockets`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "allowUpstreamProxy": { + "type": [ + "boolean", + "null" + ] + }, + "allowedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "dangerouslyAllowAllUnixSockets": { + "type": [ + "boolean", + "null" + ] + }, + "dangerouslyAllowNonLoopbackProxy": { + "type": [ + "boolean", + "null" + ] + }, + "deniedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "domains": { + "description": "Canonical network permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/NetworkDomainPermission" + } + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + }, + "httpPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "managedAllowedDomainsOnly": { + "description": "When true, only managed allowlist entries are respected while managed network enforcement is active.", + "type": [ + "boolean", + "null" + ] + }, + "socksPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "unixSockets": { + "description": "Canonical unix socket permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/NetworkUnixSocketPermission" + } + } + } + }, + "NetworkUnixSocketPermission": { + "type": "string", + "enum": [ + "allow", + "none" + ] + }, + "ResidencyRequirement": { + "type": "string", + "enum": [ + "us" + ] + }, + "ConfigRequirementsReadResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigRequirementsReadResponse", + "type": "object", + "properties": { + "requirements": { + "description": "Null if no requirements are configured (e.g. no requirements.toml/MDM entries).", + "anyOf": [ + { + "$ref": "#/definitions/ConfigRequirements" + }, + { + "type": "null" + } + ] + } + } + }, + "Account": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyAccountType" + } + }, + "title": "ApiKeyAccount" + }, + { + "type": "object", + "required": [ + "email", + "planType", + "type" + ], + "properties": { + "email": { + "type": "string" + }, + "planType": { + "$ref": "#/definitions/PlanType" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "ChatgptAccountType" + } + }, + "title": "ChatgptAccount" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "amazonBedrock" + ], + "title": "AmazonBedrockAccountType" + } + }, + "title": "AmazonBedrockAccount" + } + ] + }, + "GetAccountResponse": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountResponse", + "type": "object", + "required": [ + "requiresOpenaiAuth" + ], + "properties": { + "account": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + }, + "requiresOpenaiAuth": { + "type": "boolean" + } + } + }, + "ErrorNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ErrorNotification", + "type": "object", + "required": [ + "error", + "threadId", + "turnId", + "willRetry" + ], + "properties": { + "error": { + "$ref": "#/definitions/TurnError" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "willRetry": { + "type": "boolean" + } + } + }, + "ThreadStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartedNotification", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + } + }, + "ThreadStatusChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStatusChangedNotification", + "type": "object", + "required": [ + "status", + "threadId" + ], + "properties": { + "status": { + "$ref": "#/definitions/ThreadStatus" + }, + "threadId": { + "type": "string" + } + } + }, + "ThreadArchivedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadUnarchivedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadClosedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadClosedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "SkillsChangedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsChangedNotification", + "description": "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", + "type": "object" + }, + "ThreadNameUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadNameUpdatedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "threadName": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadGoalUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalUpdatedNotification", + "type": "object", + "required": [ + "goal", + "threadId" + ], + "properties": { + "goal": { + "$ref": "#/definitions/ThreadGoal" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadGoalClearedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalClearedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } + }, + "ThreadTokenUsage": { + "type": "object", + "required": [ + "last", + "total" + ], + "properties": { + "last": { + "$ref": "#/definitions/TokenUsageBreakdown" + }, + "modelContextWindow": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "total": { + "$ref": "#/definitions/TokenUsageBreakdown" + } + } + }, + "TokenUsageBreakdown": { + "type": "object", + "required": [ + "cachedInputTokens", + "inputTokens", + "outputTokens", + "reasoningOutputTokens", + "totalTokens" + ], + "properties": { + "cachedInputTokens": { + "type": "integer", + "format": "int64" + }, + "inputTokens": { + "type": "integer", + "format": "int64" + }, + "outputTokens": { + "type": "integer", + "format": "int64" + }, + "reasoningOutputTokens": { + "type": "integer", + "format": "int64" + }, + "totalTokens": { + "type": "integer", + "format": "int64" + } + } + }, + "ThreadTokenUsageUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadTokenUsageUpdatedNotification", + "type": "object", + "required": [ + "threadId", + "tokenUsage", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "tokenUsage": { + "$ref": "#/definitions/ThreadTokenUsage" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "displayOrder", + "entries", + "eventName", + "executionMode", + "handlerType", + "id", + "scope", + "sourcePath", + "startedAt", + "status" + ], + "properties": { + "completedAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "durationMs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/HookOutputEntry" + } + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "executionMode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source": { + "default": "unknown", + "allOf": [ + { + "$ref": "#/definitions/HookSource" + } + ] + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "startedAt": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "HookStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookStartedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "TurnCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnCompletedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + } + }, + "HookCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookCompletedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + } + }, + "TurnDiffUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnDiffUpdatedNotification", + "description": "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", + "type": "object", + "required": [ + "diff", + "threadId", + "turnId" + ], + "properties": { + "diff": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "TurnPlanStep": { + "type": "object", + "required": [ + "status", + "step" + ], + "properties": { + "status": { + "$ref": "#/definitions/TurnPlanStepStatus" + }, + "step": { + "type": "string" + } + } + }, + "TurnPlanStepStatus": { + "type": "string", + "enum": [ + "pending", + "inProgress", + "completed" + ] + }, + "TurnPlanUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnPlanUpdatedNotification", + "type": "object", + "required": [ + "plan", + "threadId", + "turnId" + ], + "properties": { + "explanation": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": "array", + "items": { + "$ref": "#/definitions/TurnPlanStep" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemStartedNotification", + "type": "object", + "required": [ + "item", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "GuardianApprovalReview": { + "description": "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "type": "object", + "required": [ + "status" + ], + "properties": { + "rationale": { + "type": [ + "string", + "null" + ] + }, + "riskLevel": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianRiskLevel" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/GuardianApprovalReviewStatus" + }, + "userAuthorization": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianUserAuthorization" + }, + { + "type": "null" + } + ] + } + } + }, + "GuardianApprovalReviewAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "cwd", + "source", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandGuardianApprovalReviewActionType" + } + }, + "title": "CommandGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "argv", + "cwd", + "program", + "source", + "type" + ], + "properties": { + "argv": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "program": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "execve" + ], + "title": "ExecveGuardianApprovalReviewActionType" + } + }, + "title": "ExecveGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "cwd", + "files", + "type" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "applyPatch" + ], + "title": "ApplyPatchGuardianApprovalReviewActionType" + } + }, + "title": "ApplyPatchGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "host", + "port", + "protocol", + "target", + "type" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + }, + "target": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "networkAccess" + ], + "title": "NetworkAccessGuardianApprovalReviewActionType" + } + }, + "title": "NetworkAccessGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "server", + "toolName", + "type" + ], + "properties": { + "connectorId": { + "type": [ + "string", + "null" + ] + }, + "connectorName": { + "type": [ + "string", + "null" + ] + }, + "server": { + "type": "string" + }, + "toolName": { + "type": "string" + }, + "toolTitle": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallGuardianApprovalReviewActionType" + } + }, + "title": "McpToolCallGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "permissions", + "type" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "requestPermissions" + ], + "title": "RequestPermissionsGuardianApprovalReviewActionType" + } + }, + "title": "RequestPermissionsGuardianApprovalReviewAction" + } + ] + }, + "GuardianApprovalReviewStatus": { + "description": "[UNSTABLE] Lifecycle state for an approval auto-review.", + "type": "string", + "enum": [ + "inProgress", + "approved", + "denied", + "timedOut", + "aborted" + ] + }, + "GuardianCommandSource": { + "type": "string", + "enum": [ + "shell", + "unifiedExec" + ] + }, + "GuardianRiskLevel": { + "description": "[UNSTABLE] Risk level assigned by approval auto-review.", + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "GuardianUserAuthorization": { + "description": "[UNSTABLE] Authorization level assigned by approval auto-review.", + "type": "string", + "enum": [ + "unknown", + "low", + "medium", + "high" + ] + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "ItemGuardianApprovalReviewStartedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewStartedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AutoReviewDecisionSource": { + "description": "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + "type": "string", + "enum": [ + "agent" + ] + }, + "ItemGuardianApprovalReviewCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewCompletedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "completedAtMs", + "decisionSource", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review completed.", + "type": "integer", + "format": "int64" + }, + "decisionSource": { + "$ref": "#/definitions/AutoReviewDecisionSource" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "ItemCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemCompletedNotification", + "type": "object", + "required": [ + "completedAtMs", + "item", + "threadId", + "turnId" + ], + "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle completed.", + "type": "integer", + "format": "int64" + }, + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "RawResponseItemCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawResponseItemCompletedNotification", + "type": "object", + "required": [ + "item", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/ResponseItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "AgentMessageDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AgentMessageDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "PlanDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PlanDeltaNotification", + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } + }, + "CommandExecOutputStream": { + "description": "Stream label for `command/exec/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + }, + "CommandExecOutputDeltaNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processId", + "stream" + ], + "properties": { + "capReached": { + "description": "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "stream": { + "description": "Output stream for this chunk.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecOutputStream" + } + ] + } + } + }, + "InitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", + "type": "object", + "properties": { + "experimentalApi": { + "description": "Opt into receiving experimental API methods and fields.", + "default": false, + "type": "boolean" + }, + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requestAttestation": { + "description": "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + "default": false, + "type": "boolean" + } + } + }, + "FuzzyFileSearchSessionUpdatedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionUpdatedNotification", + "type": "object", + "required": [ + "files", + "query", + "sessionId" + ], + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FuzzyFileSearchResult" + } + }, + "query": { + "type": "string" + }, + "sessionId": { + "type": "string" + } + } + }, + "FuzzyFileSearchParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchParams", + "type": "object", + "required": [ + "query", + "roots" + ], + "properties": { + "cancellationToken": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": "string" + }, + "roots": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "FuzzyFileSearchMatchType": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "ClientInfo": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string" + } + } + }, + "InitializeParams": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InitializeParams", + "type": "object", + "required": [ + "clientInfo" + ], + "properties": { + "capabilities": { + "anyOf": [ + { + "$ref": "#/definitions/InitializeCapabilities" + }, + { + "type": "null" + } + ] + }, + "clientInfo": { + "$ref": "#/definitions/ClientInfo" + } + } + }, + "FuzzyFileSearchResult": { + "description": "Superset of [`codex_file_search::FileMatch`]", + "type": "object", + "required": [ + "file_name", + "match_type", + "path", + "root", + "score" + ], + "properties": { + "file_name": { + "type": "string" + }, + "indices": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + }, + "match_type": { + "$ref": "#/definitions/FuzzyFileSearchMatchType" + }, + "path": { + "type": "string" + }, + "root": { + "type": "string" + }, + "score": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + } + } + }, + "FuzzyFileSearchSessionCompletedNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FuzzyFileSearchSessionCompletedNotification", + "type": "object", + "required": [ + "sessionId" + ], + "properties": { + "sessionId": { + "type": "string" + } + } + }, + "ClientRequest": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ClientRequest", + "description": "Request from the client to the server.", + "oneOf": [ + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "initialize" + ], + "title": "InitializeRequestMethod" + }, + "params": { + "$ref": "#/definitions/InitializeParams" + } + }, + "title": "InitializeRequest" + }, + { + "description": "NEW APIs", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/start" + ], + "title": "Thread/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStartParams" + } + }, + "title": "Thread/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/resume" + ], + "title": "Thread/resumeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadResumeParams" + } + }, + "title": "Thread/resumeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/fork" + ], + "title": "Thread/forkRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadForkParams" + } + }, + "title": "Thread/forkRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/archive" + ], + "title": "Thread/archiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadArchiveParams" + } + }, + "title": "Thread/archiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unsubscribe" + ], + "title": "Thread/unsubscribeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnsubscribeParams" + } + }, + "title": "Thread/unsubscribeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/name/set" + ], + "title": "Thread/name/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadSetNameParams" + } + }, + "title": "Thread/name/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/metadata/update" + ], + "title": "Thread/metadata/updateRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadMetadataUpdateParams" + } + }, + "title": "Thread/metadata/updateRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/unarchive" + ], + "title": "Thread/unarchiveRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnarchiveParams" + } + }, + "title": "Thread/unarchiveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/compact/start" + ], + "title": "Thread/compact/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadCompactStartParams" + } + }, + "title": "Thread/compact/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/shellCommand" + ], + "title": "Thread/shellCommandRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadShellCommandParams" + } + }, + "title": "Thread/shellCommandRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/approveGuardianDeniedAction" + ], + "title": "Thread/approveGuardianDeniedActionRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadApproveGuardianDeniedActionParams" + } + }, + "title": "Thread/approveGuardianDeniedActionRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/rollback" + ], + "title": "Thread/rollbackRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRollbackParams" + } + }, + "title": "Thread/rollbackRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/list" + ], + "title": "Thread/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadListParams" + } + }, + "title": "Thread/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/loaded/list" + ], + "title": "Thread/loaded/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadLoadedListParams" + } + }, + "title": "Thread/loaded/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/read" + ], + "title": "Thread/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadReadParams" + } + }, + "title": "Thread/readRequest" + }, + { + "description": "Append raw Responses API items to the thread history without starting a user turn.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "thread/inject_items" + ], + "title": "Thread/injectItemsRequestMethod" + }, + "params": { + "$ref": "#/definitions/ThreadInjectItemsParams" + } + }, + "title": "Thread/injectItemsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/list" + ], + "title": "Skills/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/SkillsListParams" + } + }, + "title": "Skills/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "hooks/list" + ], + "title": "Hooks/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/HooksListParams" + } + }, + "title": "Hooks/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/add" + ], + "title": "Marketplace/addRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceAddParams" + } + }, + "title": "Marketplace/addRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/remove" + ], + "title": "Marketplace/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceRemoveParams" + } + }, + "title": "Marketplace/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "marketplace/upgrade" + ], + "title": "Marketplace/upgradeRequestMethod" + }, + "params": { + "$ref": "#/definitions/MarketplaceUpgradeParams" + } + }, + "title": "Marketplace/upgradeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/list" + ], + "title": "Plugin/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginListParams" + } + }, + "title": "Plugin/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/installed" + ], + "title": "Plugin/installedRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginInstalledParams" + } + }, + "title": "Plugin/installedRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/read" + ], + "title": "Plugin/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginReadParams" + } + }, + "title": "Plugin/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/skill/read" + ], + "title": "Plugin/skill/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginSkillReadParams" + } + }, + "title": "Plugin/skill/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/save" + ], + "title": "Plugin/share/saveRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareSaveParams" + } + }, + "title": "Plugin/share/saveRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/updateTargets" + ], + "title": "Plugin/share/updateTargetsRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareUpdateTargetsParams" + } + }, + "title": "Plugin/share/updateTargetsRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/list" + ], + "title": "Plugin/share/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareListParams" + } + }, + "title": "Plugin/share/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/checkout" + ], + "title": "Plugin/share/checkoutRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareCheckoutParams" + } + }, + "title": "Plugin/share/checkoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/share/delete" + ], + "title": "Plugin/share/deleteRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginShareDeleteParams" + } + }, + "title": "Plugin/share/deleteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "app/list" + ], + "title": "App/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/AppsListParams" + } + }, + "title": "App/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readFile" + ], + "title": "Fs/readFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsReadFileParams" + } + }, + "title": "Fs/readFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/writeFile" + ], + "title": "Fs/writeFileRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsWriteFileParams" + } + }, + "title": "Fs/writeFileRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/createDirectory" + ], + "title": "Fs/createDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsCreateDirectoryParams" + } + }, + "title": "Fs/createDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/getMetadata" + ], + "title": "Fs/getMetadataRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsGetMetadataParams" + } + }, + "title": "Fs/getMetadataRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/readDirectory" + ], + "title": "Fs/readDirectoryRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsReadDirectoryParams" + } + }, + "title": "Fs/readDirectoryRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/remove" + ], + "title": "Fs/removeRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsRemoveParams" + } + }, + "title": "Fs/removeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/copy" + ], + "title": "Fs/copyRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsCopyParams" + } + }, + "title": "Fs/copyRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/watch" + ], + "title": "Fs/watchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsWatchParams" + } + }, + "title": "Fs/watchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fs/unwatch" + ], + "title": "Fs/unwatchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FsUnwatchParams" + } + }, + "title": "Fs/unwatchRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "skills/config/write" + ], + "title": "Skills/config/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/SkillsConfigWriteParams" + } + }, + "title": "Skills/config/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/install" + ], + "title": "Plugin/installRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginInstallParams" + } + }, + "title": "Plugin/installRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "plugin/uninstall" + ], + "title": "Plugin/uninstallRequestMethod" + }, + "params": { + "$ref": "#/definitions/PluginUninstallParams" + } + }, + "title": "Plugin/uninstallRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/start" + ], + "title": "Turn/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnStartParams" + } + }, + "title": "Turn/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/steer" + ], + "title": "Turn/steerRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnSteerParams" + } + }, + "title": "Turn/steerRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "turn/interrupt" + ], + "title": "Turn/interruptRequestMethod" + }, + "params": { + "$ref": "#/definitions/TurnInterruptParams" + } + }, + "title": "Turn/interruptRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "review/start" + ], + "title": "Review/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/ReviewStartParams" + } + }, + "title": "Review/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "model/list" + ], + "title": "Model/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ModelListParams" + } + }, + "title": "Model/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "modelProvider/capabilities/read" + ], + "title": "ModelProvider/capabilities/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ModelProviderCapabilitiesReadParams" + } + }, + "title": "ModelProvider/capabilities/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/list" + ], + "title": "ExperimentalFeature/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExperimentalFeatureListParams" + } + }, + "title": "ExperimentalFeature/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "experimentalFeature/enablement/set" + ], + "title": "ExperimentalFeature/enablement/setRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExperimentalFeatureEnablementSetParams" + } + }, + "title": "ExperimentalFeature/enablement/setRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/oauth/login" + ], + "title": "McpServer/oauth/loginRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerOauthLoginParams" + } + }, + "title": "McpServer/oauth/loginRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/mcpServer/reload" + ], + "title": "Config/mcpServer/reloadRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Config/mcpServer/reloadRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServerStatus/list" + ], + "title": "McpServerStatus/listRequestMethod" + }, + "params": { + "$ref": "#/definitions/ListMcpServerStatusParams" + } + }, + "title": "McpServerStatus/listRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/resource/read" + ], + "title": "McpServer/resource/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpResourceReadParams" + } + }, + "title": "McpServer/resource/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "mcpServer/tool/call" + ], + "title": "McpServer/tool/callRequestMethod" + }, + "params": { + "$ref": "#/definitions/McpServerToolCallParams" + } + }, + "title": "McpServer/tool/callRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupStart" + ], + "title": "WindowsSandbox/setupStartRequestMethod" + }, + "params": { + "$ref": "#/definitions/WindowsSandboxSetupStartParams" + } + }, + "title": "WindowsSandbox/setupStartRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "windowsSandbox/readiness" + ], + "title": "WindowsSandbox/readinessRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "WindowsSandbox/readinessRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/start" + ], + "title": "Account/login/startRequestMethod" + }, + "params": { + "$ref": "#/definitions/LoginAccountParams" + } + }, + "title": "Account/login/startRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/login/cancel" + ], + "title": "Account/login/cancelRequestMethod" + }, + "params": { + "$ref": "#/definitions/CancelLoginAccountParams" + } + }, + "title": "Account/login/cancelRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/logout" + ], + "title": "Account/logoutRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/logoutRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/rateLimits/read" + ], + "title": "Account/rateLimits/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "Account/rateLimits/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/sendAddCreditsNudgeEmail" + ], + "title": "Account/sendAddCreditsNudgeEmailRequestMethod" + }, + "params": { + "$ref": "#/definitions/SendAddCreditsNudgeEmailParams" + } + }, + "title": "Account/sendAddCreditsNudgeEmailRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "feedback/upload" + ], + "title": "Feedback/uploadRequestMethod" + }, + "params": { + "$ref": "#/definitions/FeedbackUploadParams" + } + }, + "title": "Feedback/uploadRequest" + }, + { + "description": "Execute a standalone command (argv vector) under the server's sandbox.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec" + ], + "title": "Command/execRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecParams" + } + }, + "title": "Command/execRequest" + }, + { + "description": "Write stdin bytes to a running `command/exec` session or close stdin.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/write" + ], + "title": "Command/exec/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecWriteParams" + } + }, + "title": "Command/exec/writeRequest" + }, + { + "description": "Terminate a running `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/terminate" + ], + "title": "Command/exec/terminateRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecTerminateParams" + } + }, + "title": "Command/exec/terminateRequest" + }, + { + "description": "Resize a running PTY-backed `command/exec` session by client-supplied `processId`.", + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "command/exec/resize" + ], + "title": "Command/exec/resizeRequestMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecResizeParams" + } + }, + "title": "Command/exec/resizeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/read" + ], + "title": "Config/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigReadParams" + } + }, + "title": "Config/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/detect" + ], + "title": "ExternalAgentConfig/detectRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigDetectParams" + } + }, + "title": "ExternalAgentConfig/detectRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import" + ], + "title": "ExternalAgentConfig/importRequestMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigImportParams" + } + }, + "title": "ExternalAgentConfig/importRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/value/write" + ], + "title": "Config/value/writeRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigValueWriteParams" + } + }, + "title": "Config/value/writeRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "config/batchWrite" + ], + "title": "Config/batchWriteRequestMethod" + }, + "params": { + "$ref": "#/definitions/ConfigBatchWriteParams" + } + }, + "title": "Config/batchWriteRequest" + }, + { + "type": "object", + "required": [ + "id", + "method" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "configRequirements/read" + ], + "title": "ConfigRequirements/readRequestMethod" + }, + "params": { + "type": "null" + } + }, + "title": "ConfigRequirements/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "account/read" + ], + "title": "Account/readRequestMethod" + }, + "params": { + "$ref": "#/definitions/GetAccountParams" + } + }, + "title": "Account/readRequest" + }, + { + "type": "object", + "required": [ + "id", + "method", + "params" + ], + "properties": { + "id": { + "$ref": "#/definitions/RequestId" + }, + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch" + ], + "title": "FuzzyFileSearchRequestMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchParams" + } + }, + "title": "FuzzyFileSearchRequest" + } + ] + }, + "ServerNotification": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerNotification", + "description": "Notification sent from the server to the client.", + "oneOf": [ + { + "description": "NEW NOTIFICATIONS", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "error" + ], + "title": "ErrorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ErrorNotification" + } + }, + "title": "ErrorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/started" + ], + "title": "Thread/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStartedNotification" + } + }, + "title": "Thread/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/status/changed" + ], + "title": "Thread/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadStatusChangedNotification" + } + }, + "title": "Thread/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/archived" + ], + "title": "Thread/archivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadArchivedNotification" + } + }, + "title": "Thread/archivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/unarchived" + ], + "title": "Thread/unarchivedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadUnarchivedNotification" + } + }, + "title": "Thread/unarchivedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/closed" + ], + "title": "Thread/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadClosedNotification" + } + }, + "title": "Thread/closedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "skills/changed" + ], + "title": "Skills/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/SkillsChangedNotification" + } + }, + "title": "Skills/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/name/updated" + ], + "title": "Thread/name/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadNameUpdatedNotification" + } + }, + "title": "Thread/name/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/updated" + ], + "title": "Thread/goal/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadGoalUpdatedNotification" + } + }, + "title": "Thread/goal/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/goal/cleared" + ], + "title": "Thread/goal/clearedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadGoalClearedNotification" + } + }, + "title": "Thread/goal/clearedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/tokenUsage/updated" + ], + "title": "Thread/tokenUsage/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadTokenUsageUpdatedNotification" + } + }, + "title": "Thread/tokenUsage/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/started" + ], + "title": "Turn/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnStartedNotification" + } + }, + "title": "Turn/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/started" + ], + "title": "Hook/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/HookStartedNotification" + } + }, + "title": "Hook/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/completed" + ], + "title": "Turn/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnCompletedNotification" + } + }, + "title": "Turn/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "hook/completed" + ], + "title": "Hook/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/HookCompletedNotification" + } + }, + "title": "Hook/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/diff/updated" + ], + "title": "Turn/diff/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnDiffUpdatedNotification" + } + }, + "title": "Turn/diff/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "turn/plan/updated" + ], + "title": "Turn/plan/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TurnPlanUpdatedNotification" + } + }, + "title": "Turn/plan/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/started" + ], + "title": "Item/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemStartedNotification" + } + }, + "title": "Item/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/started" + ], + "title": "Item/autoApprovalReview/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemGuardianApprovalReviewStartedNotification" + } + }, + "title": "Item/autoApprovalReview/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/autoApprovalReview/completed" + ], + "title": "Item/autoApprovalReview/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemGuardianApprovalReviewCompletedNotification" + } + }, + "title": "Item/autoApprovalReview/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/completed" + ], + "title": "Item/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ItemCompletedNotification" + } + }, + "title": "Item/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/agentMessage/delta" + ], + "title": "Item/agentMessage/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AgentMessageDeltaNotification" + } + }, + "title": "Item/agentMessage/deltaNotification" + }, + { + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/plan/delta" + ], + "title": "Item/plan/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/PlanDeltaNotification" + } + }, + "title": "Item/plan/deltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `command/exec` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "command/exec/outputDelta" + ], + "title": "Command/exec/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecOutputDeltaNotification" + } + }, + "title": "Command/exec/outputDeltaNotification" + }, + { + "description": "Stream base64-encoded stdout/stderr chunks for a running `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/outputDelta" + ], + "title": "Process/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ProcessOutputDeltaNotification" + } + }, + "title": "Process/outputDeltaNotification" + }, + { + "description": "Final exit notification for a `process/spawn` session.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "process/exited" + ], + "title": "Process/exitedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ProcessExitedNotification" + } + }, + "title": "Process/exitedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/outputDelta" + ], + "title": "Item/commandExecution/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/CommandExecutionOutputDeltaNotification" + } + }, + "title": "Item/commandExecution/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/commandExecution/terminalInteraction" + ], + "title": "Item/commandExecution/terminalInteractionNotificationMethod" + }, + "params": { + "$ref": "#/definitions/TerminalInteractionNotification" + } + }, + "title": "Item/commandExecution/terminalInteractionNotification" + }, + { + "description": "Deprecated legacy apply_patch output stream notification.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/outputDelta" + ], + "title": "Item/fileChange/outputDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FileChangeOutputDeltaNotification" + } + }, + "title": "Item/fileChange/outputDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/fileChange/patchUpdated" + ], + "title": "Item/fileChange/patchUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FileChangePatchUpdatedNotification" + } + }, + "title": "Item/fileChange/patchUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "serverRequest/resolved" + ], + "title": "ServerRequest/resolvedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ServerRequestResolvedNotification" + } + }, + "title": "ServerRequest/resolvedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/mcpToolCall/progress" + ], + "title": "Item/mcpToolCall/progressNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpToolCallProgressNotification" + } + }, + "title": "Item/mcpToolCall/progressNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/oauthLogin/completed" + ], + "title": "McpServer/oauthLogin/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpServerOauthLoginCompletedNotification" + } + }, + "title": "McpServer/oauthLogin/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "mcpServer/startupStatus/updated" + ], + "title": "McpServer/startupStatus/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/McpServerStatusUpdatedNotification" + } + }, + "title": "McpServer/startupStatus/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/updated" + ], + "title": "Account/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountUpdatedNotification" + } + }, + "title": "Account/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/rateLimits/updated" + ], + "title": "Account/rateLimits/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountRateLimitsUpdatedNotification" + } + }, + "title": "Account/rateLimits/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "app/list/updated" + ], + "title": "App/list/updatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AppListUpdatedNotification" + } + }, + "title": "App/list/updatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "remoteControl/status/changed" + ], + "title": "RemoteControl/status/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/RemoteControlStatusChangedNotification" + } + }, + "title": "RemoteControl/status/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "externalAgentConfig/import/completed" + ], + "title": "ExternalAgentConfig/import/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ExternalAgentConfigImportCompletedNotification" + } + }, + "title": "ExternalAgentConfig/import/completedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fs/changed" + ], + "title": "Fs/changedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FsChangedNotification" + } + }, + "title": "Fs/changedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryTextDelta" + ], + "title": "Item/reasoning/summaryTextDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningSummaryTextDeltaNotification" + } + }, + "title": "Item/reasoning/summaryTextDeltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/summaryPartAdded" + ], + "title": "Item/reasoning/summaryPartAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningSummaryPartAddedNotification" + } + }, + "title": "Item/reasoning/summaryPartAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "item/reasoning/textDelta" + ], + "title": "Item/reasoning/textDeltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ReasoningTextDeltaNotification" + } + }, + "title": "Item/reasoning/textDeltaNotification" + }, + { + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/compacted" + ], + "title": "Thread/compactedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ContextCompactedNotification" + } + }, + "title": "Thread/compactedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/rerouted" + ], + "title": "Model/reroutedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ModelReroutedNotification" + } + }, + "title": "Model/reroutedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "model/verification" + ], + "title": "Model/verificationNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ModelVerificationNotification" + } + }, + "title": "Model/verificationNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "warning" + ], + "title": "WarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WarningNotification" + } + }, + "title": "WarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "guardianWarning" + ], + "title": "GuardianWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/GuardianWarningNotification" + } + }, + "title": "GuardianWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "deprecationNotice" + ], + "title": "DeprecationNoticeNotificationMethod" + }, + "params": { + "$ref": "#/definitions/DeprecationNoticeNotification" + } + }, + "title": "DeprecationNoticeNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "configWarning" + ], + "title": "ConfigWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ConfigWarningNotification" + } + }, + "title": "ConfigWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionUpdated" + ], + "title": "FuzzyFileSearch/sessionUpdatedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionUpdatedNotification" + } + }, + "title": "FuzzyFileSearch/sessionUpdatedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "fuzzyFileSearch/sessionCompleted" + ], + "title": "FuzzyFileSearch/sessionCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/FuzzyFileSearchSessionCompletedNotification" + } + }, + "title": "FuzzyFileSearch/sessionCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/started" + ], + "title": "Thread/realtime/startedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeStartedNotification" + } + }, + "title": "Thread/realtime/startedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/itemAdded" + ], + "title": "Thread/realtime/itemAddedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeItemAddedNotification" + } + }, + "title": "Thread/realtime/itemAddedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/delta" + ], + "title": "Thread/realtime/transcript/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeTranscriptDeltaNotification" + } + }, + "title": "Thread/realtime/transcript/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/transcript/done" + ], + "title": "Thread/realtime/transcript/doneNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeTranscriptDoneNotification" + } + }, + "title": "Thread/realtime/transcript/doneNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/outputAudio/delta" + ], + "title": "Thread/realtime/outputAudio/deltaNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeOutputAudioDeltaNotification" + } + }, + "title": "Thread/realtime/outputAudio/deltaNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/sdp" + ], + "title": "Thread/realtime/sdpNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeSdpNotification" + } + }, + "title": "Thread/realtime/sdpNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/error" + ], + "title": "Thread/realtime/errorNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeErrorNotification" + } + }, + "title": "Thread/realtime/errorNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "thread/realtime/closed" + ], + "title": "Thread/realtime/closedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/ThreadRealtimeClosedNotification" + } + }, + "title": "Thread/realtime/closedNotification" + }, + { + "description": "Notifies the user of world-writable directories on Windows, which cannot be protected by the sandbox.", + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windows/worldWritableWarning" + ], + "title": "Windows/worldWritableWarningNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WindowsWorldWritableWarningNotification" + } + }, + "title": "Windows/worldWritableWarningNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "windowsSandbox/setupCompleted" + ], + "title": "WindowsSandbox/setupCompletedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/WindowsSandboxSetupCompletedNotification" + } + }, + "title": "WindowsSandbox/setupCompletedNotification" + }, + { + "type": "object", + "required": [ + "method", + "params" + ], + "properties": { + "method": { + "type": "string", + "enum": [ + "account/login/completed" + ], + "title": "Account/login/completedNotificationMethod" + }, + "params": { + "$ref": "#/definitions/AccountLoginCompletedNotification" + } + }, + "title": "Account/login/completedNotification" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v1/InitializeParams.json b/schemas/v1/InitializeParams.json new file mode 100644 index 0000000..c819e0f --- /dev/null +++ b/schemas/v1/InitializeParams.json @@ -0,0 +1,72 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InitializeParams", + "type": "object", + "required": [ + "clientInfo" + ], + "properties": { + "capabilities": { + "anyOf": [ + { + "$ref": "#/definitions/InitializeCapabilities" + }, + { + "type": "null" + } + ] + }, + "clientInfo": { + "$ref": "#/definitions/ClientInfo" + } + }, + "definitions": { + "ClientInfo": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "version": { + "type": "string" + } + } + }, + "InitializeCapabilities": { + "description": "Client-declared capabilities negotiated during initialize.", + "type": "object", + "properties": { + "experimentalApi": { + "description": "Opt into receiving experimental API methods and fields.", + "default": false, + "type": "boolean" + }, + "optOutNotificationMethods": { + "description": "Exact notification method names that should be suppressed for this connection (for example `thread/started`).", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "requestAttestation": { + "description": "Opt into `attestation/generate` requests for upstream `x-oai-attestation`.", + "default": false, + "type": "boolean" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v1/InitializeResponse.json b/schemas/v1/InitializeResponse.json new file mode 100644 index 0000000..462c818 --- /dev/null +++ b/schemas/v1/InitializeResponse.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InitializeResponse", + "type": "object", + "required": [ + "codexHome", + "platformFamily", + "platformOs", + "userAgent" + ], + "properties": { + "codexHome": { + "description": "Absolute path to the server's $CODEX_HOME directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "platformFamily": { + "description": "Platform family for the running app-server target, for example `\"unix\"` or `\"windows\"`.", + "type": "string" + }, + "platformOs": { + "description": "Operating system for the running app-server target, for example `\"macos\"`, `\"linux\"`, or `\"windows\"`.", + "type": "string" + }, + "userAgent": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/AccountLoginCompletedNotification.json b/schemas/v2/AccountLoginCompletedNotification.json new file mode 100644 index 0000000..5640734 --- /dev/null +++ b/schemas/v2/AccountLoginCompletedNotification.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountLoginCompletedNotification", + "type": "object", + "required": [ + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "loginId": { + "type": [ + "string", + "null" + ] + }, + "success": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/AccountRateLimitsUpdatedNotification.json b/schemas/v2/AccountRateLimitsUpdatedNotification.json new file mode 100644 index 0000000..14d086e --- /dev/null +++ b/schemas/v2/AccountRateLimitsUpdatedNotification.json @@ -0,0 +1,156 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountRateLimitsUpdatedNotification", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "$ref": "#/definitions/RateLimitSnapshot" + } + }, + "definitions": { + "CreditsSnapshot": { + "type": "object", + "required": [ + "hasCredits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "hasCredits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + }, + "RateLimitReachedType": { + "type": "string", + "enum": [ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limitId": { + "type": [ + "string", + "null" + ] + }, + "limitName": { + "type": [ + "string", + "null" + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "rateLimitReachedType": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitReachedType" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "usedPercent" + ], + "properties": { + "resetsAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "usedPercent": { + "type": "integer", + "format": "int32" + }, + "windowDurationMins": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/AccountUpdatedNotification.json b/schemas/v2/AccountUpdatedNotification.json new file mode 100644 index 0000000..b5e7ac7 --- /dev/null +++ b/schemas/v2/AccountUpdatedNotification.json @@ -0,0 +1,79 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AccountUpdatedNotification", + "type": "object", + "properties": { + "authMode": { + "anyOf": [ + { + "$ref": "#/definitions/AuthMode" + }, + { + "type": "null" + } + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "AuthMode": { + "description": "Authentication mode for OpenAI-backed providers.", + "oneOf": [ + { + "description": "OpenAI API key provided by the caller and stored by Codex.", + "type": "string", + "enum": [ + "apikey" + ] + }, + { + "description": "ChatGPT OAuth managed by Codex (tokens persisted and refreshed by Codex).", + "type": "string", + "enum": [ + "chatgpt" + ] + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE.\n\nChatGPT auth tokens are supplied by an external host app and are only stored in memory. Token refresh must be handled by the external host app.", + "type": "string", + "enum": [ + "chatgptAuthTokens" + ] + }, + { + "description": "Programmatic Codex auth backed by a registered Agent Identity.", + "type": "string", + "enum": [ + "agentIdentity" + ] + } + ] + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/AgentMessageDeltaNotification.json b/schemas/v2/AgentMessageDeltaNotification.json new file mode 100644 index 0000000..b286877 --- /dev/null +++ b/schemas/v2/AgentMessageDeltaNotification.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AgentMessageDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/AppListUpdatedNotification.json b/schemas/v2/AppListUpdatedNotification.json new file mode 100644 index 0000000..6fd9e84 --- /dev/null +++ b/schemas/v2/AppListUpdatedNotification.json @@ -0,0 +1,276 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppListUpdatedNotification", + "description": "EXPERIMENTAL - notification emitted when the app list changes.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AppInfo" + } + } + }, + "definitions": { + "AppBranding": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "isDiscoverableApp" + ], + "properties": { + "category": { + "type": [ + "string", + "null" + ] + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "isDiscoverableApp": { + "type": "boolean" + }, + "privacyPolicy": { + "type": [ + "string", + "null" + ] + }, + "termsOfService": { + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppInfo": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "appMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/AppMetadata" + }, + { + "type": "null" + } + ] + }, + "branding": { + "anyOf": [ + { + "$ref": "#/definitions/AppBranding" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "distributionChannel": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "isAccessible": { + "default": false, + "type": "boolean" + }, + "isEnabled": { + "description": "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + "default": true, + "type": "boolean" + }, + "labels": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "logoUrl": { + "type": [ + "string", + "null" + ] + }, + "logoUrlDark": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "pluginDisplayNames": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AppMetadata": { + "type": "object", + "properties": { + "categories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "firstPartyRequiresInstall": { + "type": [ + "boolean", + "null" + ] + }, + "firstPartyType": { + "type": [ + "string", + "null" + ] + }, + "review": { + "anyOf": [ + { + "$ref": "#/definitions/AppReview" + }, + { + "type": "null" + } + ] + }, + "screenshots": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AppScreenshot" + } + }, + "seoDescription": { + "type": [ + "string", + "null" + ] + }, + "showInComposerWhenUnlinked": { + "type": [ + "boolean", + "null" + ] + }, + "subCategories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "version": { + "type": [ + "string", + "null" + ] + }, + "versionId": { + "type": [ + "string", + "null" + ] + }, + "versionNotes": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppReview": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string" + } + } + }, + "AppScreenshot": { + "type": "object", + "required": [ + "userPrompt" + ], + "properties": { + "fileId": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "userPrompt": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/AppsListParams.json b/schemas/v2/AppsListParams.json new file mode 100644 index 0000000..5638fe1 --- /dev/null +++ b/schemas/v2/AppsListParams.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListParams", + "description": "EXPERIMENTAL - list available apps/connectors.", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "forceRefetch": { + "description": "When true, bypass app caches and fetch the latest data from sources.", + "type": "boolean" + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional thread id used to evaluate app feature gating from that thread's config.", + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/AppsListResponse.json b/schemas/v2/AppsListResponse.json new file mode 100644 index 0000000..9039981 --- /dev/null +++ b/schemas/v2/AppsListResponse.json @@ -0,0 +1,283 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AppsListResponse", + "description": "EXPERIMENTAL - app list response.", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/AppInfo" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AppBranding": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "isDiscoverableApp" + ], + "properties": { + "category": { + "type": [ + "string", + "null" + ] + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "isDiscoverableApp": { + "type": "boolean" + }, + "privacyPolicy": { + "type": [ + "string", + "null" + ] + }, + "termsOfService": { + "type": [ + "string", + "null" + ] + }, + "website": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppInfo": { + "description": "EXPERIMENTAL - app metadata returned by app-list APIs.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "appMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/AppMetadata" + }, + { + "type": "null" + } + ] + }, + "branding": { + "anyOf": [ + { + "$ref": "#/definitions/AppBranding" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "distributionChannel": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "isAccessible": { + "default": false, + "type": "boolean" + }, + "isEnabled": { + "description": "Whether this app is enabled in config.toml. Example: ```toml [apps.bad_app] enabled = false ```", + "default": true, + "type": "boolean" + }, + "labels": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "logoUrl": { + "type": [ + "string", + "null" + ] + }, + "logoUrlDark": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "pluginDisplayNames": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "AppMetadata": { + "type": "object", + "properties": { + "categories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developer": { + "type": [ + "string", + "null" + ] + }, + "firstPartyRequiresInstall": { + "type": [ + "boolean", + "null" + ] + }, + "firstPartyType": { + "type": [ + "string", + "null" + ] + }, + "review": { + "anyOf": [ + { + "$ref": "#/definitions/AppReview" + }, + { + "type": "null" + } + ] + }, + "screenshots": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AppScreenshot" + } + }, + "seoDescription": { + "type": [ + "string", + "null" + ] + }, + "showInComposerWhenUnlinked": { + "type": [ + "boolean", + "null" + ] + }, + "subCategories": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "version": { + "type": [ + "string", + "null" + ] + }, + "versionId": { + "type": [ + "string", + "null" + ] + }, + "versionNotes": { + "type": [ + "string", + "null" + ] + } + } + }, + "AppReview": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string" + } + } + }, + "AppScreenshot": { + "type": "object", + "required": [ + "userPrompt" + ], + "properties": { + "fileId": { + "type": [ + "string", + "null" + ] + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "userPrompt": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/CancelLoginAccountParams.json b/schemas/v2/CancelLoginAccountParams.json new file mode 100644 index 0000000..c7a5d10 --- /dev/null +++ b/schemas/v2/CancelLoginAccountParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountParams", + "type": "object", + "required": [ + "loginId" + ], + "properties": { + "loginId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/CancelLoginAccountResponse.json b/schemas/v2/CancelLoginAccountResponse.json new file mode 100644 index 0000000..939ab6e --- /dev/null +++ b/schemas/v2/CancelLoginAccountResponse.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CancelLoginAccountResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/CancelLoginAccountStatus" + } + }, + "definitions": { + "CancelLoginAccountStatus": { + "type": "string", + "enum": [ + "canceled", + "notFound" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecOutputDeltaNotification.json b/schemas/v2/CommandExecOutputDeltaNotification.json new file mode 100644 index 0000000..a1a3876 --- /dev/null +++ b/schemas/v2/CommandExecOutputDeltaNotification.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `command/exec` request.\n\nThese notifications are connection-scoped. If the originating connection closes, the server terminates the process.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processId", + "stream" + ], + "properties": { + "capReached": { + "description": "`true` on the final streamed chunk for a stream when `outputBytesCap` truncated later output on that stream.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "stream": { + "description": "Output stream for this chunk.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecOutputStream" + } + ] + } + }, + "definitions": { + "CommandExecOutputStream": { + "description": "Stream label for `command/exec/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecParams.json b/schemas/v2/CommandExecParams.json new file mode 100644 index 0000000..a2edc43 --- /dev/null +++ b/schemas/v2/CommandExecParams.json @@ -0,0 +1,258 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecParams", + "description": "Run a standalone command (argv vector) in the server sandbox without creating a thread or turn.\n\nThe final `command/exec` response is deferred until the process exits and is sent only after all `command/exec/outputDelta` notifications for that connection have been emitted.", + "type": "object", + "required": [ + "command" + ], + "properties": { + "command": { + "description": "Command argv vector. Empty arrays are rejected.", + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "description": "Optional working directory. Defaults to the server cwd.", + "type": [ + "string", + "null" + ] + }, + "disableOutputCap": { + "description": "Disable stdout/stderr capture truncation for this request.\n\nCannot be combined with `outputBytesCap`.", + "type": "boolean" + }, + "disableTimeout": { + "description": "Disable the timeout entirely for this request.\n\nCannot be combined with `timeoutMs`.", + "type": "boolean" + }, + "env": { + "description": "Optional environment overrides merged into the server-computed environment.\n\nMatching names override inherited values. Set a key to `null` to unset an inherited variable.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": [ + "string", + "null" + ] + } + }, + "outputBytesCap": { + "description": "Optional per-stream stdout/stderr capture cap in bytes.\n\nWhen omitted, the server default applies. Cannot be combined with `disableOutputCap`.", + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 0.0 + }, + "tty": { + "description": "Enable PTY mode.\n\nThis implies `streamStdin` and `streamStdoutStderr`.", + "type": "boolean" + }, + "processId": { + "description": "Optional client-supplied, connection-scoped process id.\n\nRequired for `tty`, `streamStdin`, `streamStdoutStderr`, and follow-up `command/exec/write`, `command/exec/resize`, and `command/exec/terminate` calls. When omitted, buffered execution gets an internal id that is not exposed to the client.", + "type": [ + "string", + "null" + ] + }, + "sandboxPolicy": { + "description": "Optional sandbox policy for this command.\n\nUses the same shape as thread/turn execution sandbox configuration and defaults to the user's configured policy when omitted. Cannot be combined with `permissionProfile`.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + }, + "size": { + "description": "Optional initial PTY size in character cells. Only valid when `tty` is true.", + "anyOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + }, + { + "type": "null" + } + ] + }, + "streamStdin": { + "description": "Allow follow-up `command/exec/write` requests to write stdin bytes.\n\nRequires a client-supplied `processId`.", + "type": "boolean" + }, + "streamStdoutStderr": { + "description": "Stream stdout/stderr via `command/exec/outputDelta` notifications.\n\nStreamed bytes are not duplicated into the final response and require a client-supplied `processId`.", + "type": "boolean" + }, + "timeoutMs": { + "description": "Optional timeout in milliseconds.\n\nWhen omitted, the server default applies. Cannot be combined with `disableTimeout`.", + "type": [ + "integer", + "null" + ], + "format": "int64" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "CommandExecTerminalSize": { + "description": "PTY size in character cells for `command/exec` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecResizeParams.json b/schemas/v2/CommandExecResizeParams.json new file mode 100644 index 0000000..cd716a2 --- /dev/null +++ b/schemas/v2/CommandExecResizeParams.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeParams", + "description": "Resize a running PTY-backed `command/exec` session.", + "type": "object", + "required": [ + "processId", + "size" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + }, + "size": { + "description": "New PTY size in character cells.", + "allOf": [ + { + "$ref": "#/definitions/CommandExecTerminalSize" + } + ] + } + }, + "definitions": { + "CommandExecTerminalSize": { + "description": "PTY size in character cells for `command/exec` PTY sessions.", + "type": "object", + "required": [ + "cols", + "rows" + ], + "properties": { + "cols": { + "description": "Terminal width in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "rows": { + "description": "Terminal height in character cells.", + "type": "integer", + "format": "uint16", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecResizeResponse.json b/schemas/v2/CommandExecResizeResponse.json new file mode 100644 index 0000000..ddabfa5 --- /dev/null +++ b/schemas/v2/CommandExecResizeResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResizeResponse", + "description": "Empty success response for `command/exec/resize`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/CommandExecResponse.json b/schemas/v2/CommandExecResponse.json new file mode 100644 index 0000000..d10361a --- /dev/null +++ b/schemas/v2/CommandExecResponse.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecResponse", + "description": "Final buffered result for `command/exec`.", + "type": "object", + "required": [ + "exitCode", + "stderr", + "stdout" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `command/exec/outputDelta`.", + "type": "string" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `command/exec/outputDelta`.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecTerminateParams.json b/schemas/v2/CommandExecTerminateParams.json new file mode 100644 index 0000000..77ddbe1 --- /dev/null +++ b/schemas/v2/CommandExecTerminateParams.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateParams", + "description": "Terminate a running `command/exec` session.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecTerminateResponse.json b/schemas/v2/CommandExecTerminateResponse.json new file mode 100644 index 0000000..244df8a --- /dev/null +++ b/schemas/v2/CommandExecTerminateResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecTerminateResponse", + "description": "Empty success response for `command/exec/terminate`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/CommandExecWriteParams.json b/schemas/v2/CommandExecWriteParams.json new file mode 100644 index 0000000..493b3f4 --- /dev/null +++ b/schemas/v2/CommandExecWriteParams.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteParams", + "description": "Write stdin bytes to a running `command/exec` session, close stdin, or both.", + "type": "object", + "required": [ + "processId" + ], + "properties": { + "closeStdin": { + "description": "Close stdin after writing `deltaBase64`, if present.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Optional base64-encoded stdin bytes to write.", + "type": [ + "string", + "null" + ] + }, + "processId": { + "description": "Client-supplied, connection-scoped `processId` from the original `command/exec` request.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/CommandExecWriteResponse.json b/schemas/v2/CommandExecWriteResponse.json new file mode 100644 index 0000000..cd5fe63 --- /dev/null +++ b/schemas/v2/CommandExecWriteResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecWriteResponse", + "description": "Empty success response for `command/exec/write`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/CommandExecutionOutputDeltaNotification.json b/schemas/v2/CommandExecutionOutputDeltaNotification.json new file mode 100644 index 0000000..5aa9095 --- /dev/null +++ b/schemas/v2/CommandExecutionOutputDeltaNotification.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CommandExecutionOutputDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigBatchWriteParams.json b/schemas/v2/ConfigBatchWriteParams.json new file mode 100644 index 0000000..c93499b --- /dev/null +++ b/schemas/v2/ConfigBatchWriteParams.json @@ -0,0 +1,59 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigBatchWriteParams", + "type": "object", + "required": [ + "edits" + ], + "properties": { + "edits": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigEdit" + } + }, + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "reloadUserConfig": { + "description": "When true, hot-reload the updated user config into all loaded threads after writing.", + "type": "boolean" + } + }, + "definitions": { + "ConfigEdit": { + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + } + }, + "MergeStrategy": { + "type": "string", + "enum": [ + "replace", + "upsert" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigReadParams.json b/schemas/v2/ConfigReadParams.json new file mode 100644 index 0000000..364cfd0 --- /dev/null +++ b/schemas/v2/ConfigReadParams.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadParams", + "type": "object", + "properties": { + "cwd": { + "description": "Optional working directory to resolve project config layers. If specified, return the effective config as seen from that directory (i.e., including any project layers between `cwd` and the project/repo root).", + "type": [ + "string", + "null" + ] + }, + "includeLayers": { + "default": false, + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigReadResponse.json b/schemas/v2/ConfigReadResponse.json new file mode 100644 index 0000000..ae3c397 --- /dev/null +++ b/schemas/v2/ConfigReadResponse.json @@ -0,0 +1,913 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigReadResponse", + "type": "object", + "required": [ + "config", + "origins" + ], + "properties": { + "config": { + "$ref": "#/definitions/Config" + }, + "layers": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ConfigLayer" + } + }, + "origins": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ConfigLayerMetadata" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AnalyticsConfig": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + }, + "additionalProperties": true + }, + "AppConfig": { + "type": "object", + "properties": { + "default_tools_approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "default_tools_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "destructive_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "type": [ + "boolean", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolsConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppToolApproval": { + "type": "string", + "enum": [ + "auto", + "prompt", + "approve" + ] + }, + "AppToolConfig": { + "type": "object", + "properties": { + "approval_mode": { + "anyOf": [ + { + "$ref": "#/definitions/AppToolApproval" + }, + { + "type": "null" + } + ] + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AppToolsConfig": { + "type": "object" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AppsConfig": { + "type": "object", + "properties": { + "_default": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AppsDefaultConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "AppsDefaultConfig": { + "type": "object", + "properties": { + "destructive_enabled": { + "default": true, + "type": "boolean" + }, + "enabled": { + "default": true, + "type": "boolean" + }, + "open_world_enabled": { + "default": true, + "type": "boolean" + } + } + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "Config": { + "type": "object", + "properties": { + "analytics": { + "anyOf": [ + { + "$ref": "#/definitions/AnalyticsConfig" + }, + { + "type": "null" + } + ] + }, + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional default for where approval requests are routed for review.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchMode" + }, + { + "type": "null" + } + ] + }, + "compact_prompt": { + "type": [ + "string", + "null" + ] + }, + "desktop": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "forced_chatgpt_workspace_id": { + "anyOf": [ + { + "$ref": "#/definitions/ForcedChatgptWorkspaceIds" + }, + { + "type": "null" + } + ] + }, + "forced_login_method": { + "anyOf": [ + { + "$ref": "#/definitions/ForcedLoginMethod" + }, + { + "type": "null" + } + ] + }, + "instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_auto_compact_token_limit": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_context_window": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/Verbosity" + }, + { + "type": "null" + } + ] + }, + "profile": { + "type": [ + "string", + "null" + ] + }, + "profiles": { + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ProfileV2" + } + }, + "review_model": { + "type": [ + "string", + "null" + ] + }, + "sandbox_mode": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sandbox_workspace_write": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxWorkspaceWrite" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/ToolsV2" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "ConfigLayer": { + "type": "object", + "required": [ + "config", + "name", + "version" + ], + "properties": { + "config": true, + "disabledReason": { + "type": [ + "string", + "null" + ] + }, + "name": { + "$ref": "#/definitions/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerMetadata": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "$ref": "#/definitions/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerSource": { + "oneOf": [ + { + "description": "Managed preferences layer delivered by MDM (macOS only).", + "type": "object", + "required": [ + "domain", + "key", + "type" + ], + "properties": { + "domain": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mdm" + ], + "title": "MdmConfigLayerSourceType" + } + }, + "title": "MdmConfigLayerSource" + }, + { + "description": "Managed config layer from a file (usually `managed_config.toml`).", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the system config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "system" + ], + "title": "SystemConfigLayerSourceType" + } + }, + "title": "SystemConfigLayerSource" + }, + { + "description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "profile": { + "description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "user" + ], + "title": "UserConfigLayerSourceType" + } + }, + "title": "UserConfigLayerSource" + }, + { + "description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + "type": "object", + "required": [ + "dotCodexFolder", + "type" + ], + "properties": { + "dotCodexFolder": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "project" + ], + "title": "ProjectConfigLayerSourceType" + } + }, + "title": "ProjectConfigLayerSource" + }, + { + "description": "Session-layer overrides supplied via `-c`/`--config`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "sessionFlags" + ], + "title": "SessionFlagsConfigLayerSourceType" + } + }, + "title": "SessionFlagsConfigLayerSource" + }, + { + "description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromFile" + ], + "title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromFileConfigLayerSource" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromMdm" + ], + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSource" + } + ] + }, + "ForcedChatgptWorkspaceIds": { + "description": "Backward-compatible API shape for ChatGPT workspace login restrictions.", + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ForcedLoginMethod": { + "type": "string", + "enum": [ + "chatgpt", + "api" + ] + }, + "ProfileV2": { + "type": "object", + "properties": { + "approval_policy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvals_reviewer": { + "description": "[UNSTABLE] Optional profile-level override for where approval requests are routed for review. If omitted, the enclosing config default is used.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "chatgpt_base_url": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "model_provider": { + "type": [ + "string", + "null" + ] + }, + "model_reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "model_reasoning_summary": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "model_verbosity": { + "anyOf": [ + { + "$ref": "#/definitions/Verbosity" + }, + { + "type": "null" + } + ] + }, + "service_tier": { + "type": [ + "string", + "null" + ] + }, + "tools": { + "anyOf": [ + { + "$ref": "#/definitions/ToolsV2" + }, + { + "type": "null" + } + ] + }, + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchMode" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": true + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "SandboxWorkspaceWrite": { + "type": "object", + "properties": { + "exclude_slash_tmp": { + "default": false, + "type": "boolean" + }, + "exclude_tmpdir_env_var": { + "default": false, + "type": "boolean" + }, + "network_access": { + "default": false, + "type": "boolean" + }, + "writable_roots": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ToolsV2": { + "type": "object", + "properties": { + "web_search": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchToolConfig" + }, + { + "type": "null" + } + ] + } + } + }, + "Verbosity": { + "description": "Controls output length/detail on GPT-5 models via the Responses API. Serialized with lowercase values to match the OpenAI API.", + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchContextSize": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "WebSearchLocation": { + "type": "object", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "region": { + "type": [ + "string", + "null" + ] + }, + "timezone": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "WebSearchMode": { + "type": "string", + "enum": [ + "disabled", + "cached", + "live" + ] + }, + "WebSearchToolConfig": { + "type": "object", + "properties": { + "allowed_domains": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "context_size": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchContextSize" + }, + { + "type": "null" + } + ] + }, + "location": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchLocation" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigRequirementsReadResponse.json b/schemas/v2/ConfigRequirementsReadResponse.json new file mode 100644 index 0000000..c630b1c --- /dev/null +++ b/schemas/v2/ConfigRequirementsReadResponse.json @@ -0,0 +1,455 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigRequirementsReadResponse", + "type": "object", + "properties": { + "requirements": { + "description": "Null if no requirements are configured (e.g. no requirements.toml/MDM entries).", + "anyOf": [ + { + "$ref": "#/definitions/ConfigRequirements" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ConfigRequirements": { + "type": "object", + "properties": { + "allowManagedHooksOnly": { + "type": [ + "boolean", + "null" + ] + }, + "allowedApprovalPolicies": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AskForApproval" + } + }, + "featureRequirements": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "boolean" + } + }, + "allowedSandboxModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/SandboxMode" + } + }, + "allowedWebSearchModes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/WebSearchMode" + } + }, + "enforceResidency": { + "anyOf": [ + { + "$ref": "#/definitions/ResidencyRequirement" + }, + { + "type": "null" + } + ] + } + } + }, + "ConfiguredHookHandler": { + "oneOf": [ + { + "type": "object", + "required": [ + "async", + "command", + "type" + ], + "properties": { + "async": { + "type": "boolean" + }, + "command": { + "type": "string" + }, + "commandWindows": { + "type": [ + "string", + "null" + ] + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandConfiguredHookHandlerType" + } + }, + "title": "CommandConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "prompt" + ], + "title": "PromptConfiguredHookHandlerType" + } + }, + "title": "PromptConfiguredHookHandler" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "agent" + ], + "title": "AgentConfiguredHookHandlerType" + } + }, + "title": "AgentConfiguredHookHandler" + } + ] + }, + "ConfiguredHookMatcherGroup": { + "type": "object", + "required": [ + "hooks" + ], + "properties": { + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookHandler" + } + }, + "matcher": { + "type": [ + "string", + "null" + ] + } + } + }, + "ManagedHooksRequirements": { + "type": "object", + "required": [ + "PermissionRequest", + "PostCompact", + "PostToolUse", + "PreCompact", + "PreToolUse", + "SessionStart", + "Stop", + "UserPromptSubmit" + ], + "properties": { + "PermissionRequest": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PostCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PostToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PreCompact": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "PreToolUse": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "SessionStart": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "Stop": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "UserPromptSubmit": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfiguredHookMatcherGroup" + } + }, + "managedDir": { + "type": [ + "string", + "null" + ] + }, + "windowsManagedDir": { + "type": [ + "string", + "null" + ] + } + } + }, + "NetworkDomainPermission": { + "type": "string", + "enum": [ + "allow", + "deny" + ] + }, + "NetworkRequirements": { + "type": "object", + "properties": { + "allowLocalBinding": { + "type": [ + "boolean", + "null" + ] + }, + "allowUnixSockets": { + "description": "Legacy compatibility view derived from `unix_sockets`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "allowUpstreamProxy": { + "type": [ + "boolean", + "null" + ] + }, + "allowedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "dangerouslyAllowAllUnixSockets": { + "type": [ + "boolean", + "null" + ] + }, + "dangerouslyAllowNonLoopbackProxy": { + "type": [ + "boolean", + "null" + ] + }, + "deniedDomains": { + "description": "Legacy compatibility view derived from `domains`.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "domains": { + "description": "Canonical network permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/NetworkDomainPermission" + } + }, + "enabled": { + "type": [ + "boolean", + "null" + ] + }, + "httpPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "managedAllowedDomainsOnly": { + "description": "When true, only managed allowlist entries are respected while managed network enforcement is active.", + "type": [ + "boolean", + "null" + ] + }, + "socksPort": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + }, + "unixSockets": { + "description": "Canonical unix socket permission map for `experimental_network`.", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/NetworkUnixSocketPermission" + } + } + } + }, + "NetworkUnixSocketPermission": { + "type": "string", + "enum": [ + "allow", + "none" + ] + }, + "ResidencyRequirement": { + "type": "string", + "enum": [ + "us" + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "WebSearchMode": { + "type": "string", + "enum": [ + "disabled", + "cached", + "live" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigValueWriteParams.json b/schemas/v2/ConfigValueWriteParams.json new file mode 100644 index 0000000..46d6625 --- /dev/null +++ b/schemas/v2/ConfigValueWriteParams.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigValueWriteParams", + "type": "object", + "required": [ + "keyPath", + "mergeStrategy", + "value" + ], + "properties": { + "expectedVersion": { + "type": [ + "string", + "null" + ] + }, + "filePath": { + "description": "Path to the config file to write; defaults to the user's `config.toml` when omitted.", + "type": [ + "string", + "null" + ] + }, + "keyPath": { + "type": "string" + }, + "mergeStrategy": { + "$ref": "#/definitions/MergeStrategy" + }, + "value": true + }, + "definitions": { + "MergeStrategy": { + "type": "string", + "enum": [ + "replace", + "upsert" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigWarningNotification.json b/schemas/v2/ConfigWarningNotification.json new file mode 100644 index 0000000..131d55e --- /dev/null +++ b/schemas/v2/ConfigWarningNotification.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWarningNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance or error details.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Optional path to the config file that triggered the warning.", + "type": [ + "string", + "null" + ] + }, + "range": { + "description": "Optional range for the error location inside the config file.", + "anyOf": [ + { + "$ref": "#/definitions/TextRange" + }, + { + "type": "null" + } + ] + }, + "summary": { + "description": "Concise summary of the warning.", + "type": "string" + } + }, + "definitions": { + "TextPosition": { + "type": "object", + "required": [ + "column", + "line" + ], + "properties": { + "column": { + "description": "1-based column number (in Unicode scalar values).", + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "line": { + "description": "1-based line number.", + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "TextRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "$ref": "#/definitions/TextPosition" + }, + "start": { + "$ref": "#/definitions/TextPosition" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ConfigWriteResponse.json b/schemas/v2/ConfigWriteResponse.json new file mode 100644 index 0000000..7899ec7 --- /dev/null +++ b/schemas/v2/ConfigWriteResponse.json @@ -0,0 +1,244 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ConfigWriteResponse", + "type": "object", + "required": [ + "filePath", + "status", + "version" + ], + "properties": { + "filePath": { + "description": "Canonical path to the config file that was written.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "overriddenMetadata": { + "anyOf": [ + { + "$ref": "#/definitions/OverriddenMetadata" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/WriteStatus" + }, + "version": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ConfigLayerMetadata": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "$ref": "#/definitions/ConfigLayerSource" + }, + "version": { + "type": "string" + } + } + }, + "ConfigLayerSource": { + "oneOf": [ + { + "description": "Managed preferences layer delivered by MDM (macOS only).", + "type": "object", + "required": [ + "domain", + "key", + "type" + ], + "properties": { + "domain": { + "type": "string" + }, + "key": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mdm" + ], + "title": "MdmConfigLayerSourceType" + } + }, + "title": "MdmConfigLayerSource" + }, + { + "description": "Managed config layer from a file (usually `managed_config.toml`).", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the system config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "system" + ], + "title": "SystemConfigLayerSourceType" + } + }, + "title": "SystemConfigLayerSource" + }, + { + "description": "User config layer from $CODEX_HOME/config.toml. This layer is special in that it is expected to be: - writable by the user - generally outside the workspace directory", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "description": "This is the path to the user's config.toml file, though it is not guaranteed to exist.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "profile": { + "description": "Name of the selected profile-v2 config layered on top of the base user config, when this layer represents one.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "user" + ], + "title": "UserConfigLayerSourceType" + } + }, + "title": "UserConfigLayerSource" + }, + { + "description": "Path to a .codex/ folder within a project. There could be multiple of these between `cwd` and the project/repo root.", + "type": "object", + "required": [ + "dotCodexFolder", + "type" + ], + "properties": { + "dotCodexFolder": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "project" + ], + "title": "ProjectConfigLayerSourceType" + } + }, + "title": "ProjectConfigLayerSource" + }, + { + "description": "Session-layer overrides supplied via `-c`/`--config`.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "sessionFlags" + ], + "title": "SessionFlagsConfigLayerSourceType" + } + }, + "title": "SessionFlagsConfigLayerSource" + }, + { + "description": "`managed_config.toml` was designed to be a config that was loaded as the last layer on top of everything else. This scheme did not quite work out as intended, but we keep this variant as a \"best effort\" while we phase out `managed_config.toml` in favor of `requirements.toml`.", + "type": "object", + "required": [ + "file", + "type" + ], + "properties": { + "file": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromFile" + ], + "title": "LegacyManagedConfigTomlFromFileConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromFileConfigLayerSource" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "legacyManagedConfigTomlFromMdm" + ], + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSourceType" + } + }, + "title": "LegacyManagedConfigTomlFromMdmConfigLayerSource" + } + ] + }, + "OverriddenMetadata": { + "type": "object", + "required": [ + "effectiveValue", + "message", + "overridingLayer" + ], + "properties": { + "effectiveValue": true, + "message": { + "type": "string" + }, + "overridingLayer": { + "$ref": "#/definitions/ConfigLayerMetadata" + } + } + }, + "WriteStatus": { + "type": "string", + "enum": [ + "ok", + "okOverridden" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ContextCompactedNotification.json b/schemas/v2/ContextCompactedNotification.json new file mode 100644 index 0000000..4ca69d2 --- /dev/null +++ b/schemas/v2/ContextCompactedNotification.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ContextCompactedNotification", + "description": "Deprecated: Use `ContextCompaction` item type instead.", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/DeprecationNoticeNotification.json b/schemas/v2/DeprecationNoticeNotification.json new file mode 100644 index 0000000..6781b4e --- /dev/null +++ b/schemas/v2/DeprecationNoticeNotification.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DeprecationNoticeNotification", + "type": "object", + "required": [ + "summary" + ], + "properties": { + "details": { + "description": "Optional extra guidance, such as migration steps or rationale.", + "type": [ + "string", + "null" + ] + }, + "summary": { + "description": "Concise summary of what is deprecated.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ErrorNotification.json b/schemas/v2/ErrorNotification.json new file mode 100644 index 0000000..01332a2 --- /dev/null +++ b/schemas/v2/ErrorNotification.json @@ -0,0 +1,199 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ErrorNotification", + "type": "object", + "required": [ + "error", + "threadId", + "turnId", + "willRetry" + ], + "properties": { + "error": { + "$ref": "#/definitions/TurnError" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "willRetry": { + "type": "boolean" + } + }, + "definitions": { + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExperimentalFeatureEnablementSetParams.json b/schemas/v2/ExperimentalFeatureEnablementSetParams.json new file mode 100644 index 0000000..c21ae87 --- /dev/null +++ b/schemas/v2/ExperimentalFeatureEnablementSetParams.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetParams", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Process-wide runtime feature enablement keyed by canonical feature name.\n\nOnly named features are updated. Omitted features are left unchanged. Send an empty map for a no-op.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExperimentalFeatureEnablementSetResponse.json b/schemas/v2/ExperimentalFeatureEnablementSetResponse.json new file mode 100644 index 0000000..d53de60 --- /dev/null +++ b/schemas/v2/ExperimentalFeatureEnablementSetResponse.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureEnablementSetResponse", + "type": "object", + "required": [ + "enablement" + ], + "properties": { + "enablement": { + "description": "Feature enablement entries updated by this request.", + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExperimentalFeatureListParams.json b/schemas/v2/ExperimentalFeatureListParams.json new file mode 100644 index 0000000..c4fa289 --- /dev/null +++ b/schemas/v2/ExperimentalFeatureListParams.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "description": "Optional loaded thread id. Pass this when showing feature state for an existing thread so enablement is computed from that thread's refreshed config, including project-local config for the thread's cwd.", + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExperimentalFeatureListResponse.json b/schemas/v2/ExperimentalFeatureListResponse.json new file mode 100644 index 0000000..f9d5efa --- /dev/null +++ b/schemas/v2/ExperimentalFeatureListResponse.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExperimentalFeatureListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/ExperimentalFeature" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "ExperimentalFeature": { + "type": "object", + "required": [ + "defaultEnabled", + "enabled", + "name", + "stage" + ], + "properties": { + "announcement": { + "description": "Announcement copy shown to users when the feature is introduced. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "defaultEnabled": { + "description": "Whether this feature is enabled by default.", + "type": "boolean" + }, + "description": { + "description": "Short summary describing what the feature does. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "displayName": { + "description": "User-facing display name shown in the experimental features UI. Null when this feature is not in beta.", + "type": [ + "string", + "null" + ] + }, + "enabled": { + "description": "Whether this feature is currently enabled in the loaded config.", + "type": "boolean" + }, + "name": { + "description": "Stable key used in config.toml and CLI flag toggles.", + "type": "string" + }, + "stage": { + "description": "Lifecycle stage of this feature flag.", + "allOf": [ + { + "$ref": "#/definitions/ExperimentalFeatureStage" + } + ] + } + } + }, + "ExperimentalFeatureStage": { + "oneOf": [ + { + "description": "Feature is available for user testing and feedback.", + "type": "string", + "enum": [ + "beta" + ] + }, + { + "description": "Feature is still being built and not ready for broad use.", + "type": "string", + "enum": [ + "underDevelopment" + ] + }, + { + "description": "Feature is production-ready.", + "type": "string", + "enum": [ + "stable" + ] + }, + { + "description": "Feature is deprecated and should be avoided.", + "type": "string", + "enum": [ + "deprecated" + ] + }, + { + "description": "Feature flag is retained only for backwards compatibility.", + "type": "string", + "enum": [ + "removed" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExternalAgentConfigDetectParams.json b/schemas/v2/ExternalAgentConfigDetectParams.json new file mode 100644 index 0000000..0cf8ba8 --- /dev/null +++ b/schemas/v2/ExternalAgentConfigDetectParams.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectParams", + "type": "object", + "properties": { + "cwds": { + "description": "Zero or more working directories to include for repo-scoped detection.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeHome": { + "description": "If true, include detection under the user's home (~/.claude, ~/.codex, etc.).", + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExternalAgentConfigDetectResponse.json b/schemas/v2/ExternalAgentConfigDetectResponse.json new file mode 100644 index 0000000..bf2213c --- /dev/null +++ b/schemas/v2/ExternalAgentConfigDetectResponse.json @@ -0,0 +1,194 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigDetectResponse", + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItem" + } + } + }, + "definitions": { + "CommandMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigMigrationItem": { + "type": "object", + "required": [ + "description", + "itemType" + ], + "properties": { + "cwd": { + "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "$ref": "#/definitions/MigrationDetails" + }, + { + "type": "null" + } + ] + }, + "itemType": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItemType" + } + } + }, + "ExternalAgentConfigMigrationItemType": { + "type": "string", + "enum": [ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "SESSIONS" + ] + }, + "HookMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "McpServerMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "MigrationDetails": { + "type": "object", + "properties": { + "commands": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/CommandMigration" + } + }, + "hooks": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/HookMigration" + } + }, + "mcpServers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/McpServerMigration" + } + }, + "plugins": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PluginsMigration" + } + }, + "sessions": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SessionMigration" + } + }, + "subagents": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SubagentMigration" + } + } + } + }, + "PluginsMigration": { + "type": "object", + "required": [ + "marketplaceName", + "pluginNames" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "pluginNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SessionMigration": { + "type": "object", + "required": [ + "cwd", + "path" + ], + "properties": { + "cwd": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "SubagentMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExternalAgentConfigImportCompletedNotification.json b/schemas/v2/ExternalAgentConfigImportCompletedNotification.json new file mode 100644 index 0000000..b1a5770 --- /dev/null +++ b/schemas/v2/ExternalAgentConfigImportCompletedNotification.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportCompletedNotification", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ExternalAgentConfigImportParams.json b/schemas/v2/ExternalAgentConfigImportParams.json new file mode 100644 index 0000000..89d03ce --- /dev/null +++ b/schemas/v2/ExternalAgentConfigImportParams.json @@ -0,0 +1,194 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportParams", + "type": "object", + "required": [ + "migrationItems" + ], + "properties": { + "migrationItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItem" + } + } + }, + "definitions": { + "CommandMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "ExternalAgentConfigMigrationItem": { + "type": "object", + "required": [ + "description", + "itemType" + ], + "properties": { + "cwd": { + "description": "Null or empty means home-scoped migration; non-empty means repo-scoped migration.", + "type": [ + "string", + "null" + ] + }, + "description": { + "type": "string" + }, + "details": { + "anyOf": [ + { + "$ref": "#/definitions/MigrationDetails" + }, + { + "type": "null" + } + ] + }, + "itemType": { + "$ref": "#/definitions/ExternalAgentConfigMigrationItemType" + } + } + }, + "ExternalAgentConfigMigrationItemType": { + "type": "string", + "enum": [ + "AGENTS_MD", + "CONFIG", + "SKILLS", + "PLUGINS", + "MCP_SERVER_CONFIG", + "SUBAGENTS", + "HOOKS", + "COMMANDS", + "SESSIONS" + ] + }, + "HookMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "McpServerMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "MigrationDetails": { + "type": "object", + "properties": { + "commands": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/CommandMigration" + } + }, + "hooks": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/HookMigration" + } + }, + "mcpServers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/McpServerMigration" + } + }, + "plugins": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/PluginsMigration" + } + }, + "sessions": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SessionMigration" + } + }, + "subagents": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/SubagentMigration" + } + } + } + }, + "PluginsMigration": { + "type": "object", + "required": [ + "marketplaceName", + "pluginNames" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "pluginNames": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "SessionMigration": { + "type": "object", + "required": [ + "cwd", + "path" + ], + "properties": { + "cwd": { + "type": "string" + }, + "path": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + } + } + }, + "SubagentMigration": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ExternalAgentConfigImportResponse.json b/schemas/v2/ExternalAgentConfigImportResponse.json new file mode 100644 index 0000000..6823495 --- /dev/null +++ b/schemas/v2/ExternalAgentConfigImportResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExternalAgentConfigImportResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/FeedbackUploadParams.json b/schemas/v2/FeedbackUploadParams.json new file mode 100644 index 0000000..3bb6ddb --- /dev/null +++ b/schemas/v2/FeedbackUploadParams.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadParams", + "type": "object", + "required": [ + "classification", + "includeLogs" + ], + "properties": { + "classification": { + "type": "string" + }, + "extraLogFiles": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "includeLogs": { + "type": "boolean" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "tags": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "threadId": { + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/FeedbackUploadResponse.json b/schemas/v2/FeedbackUploadResponse.json new file mode 100644 index 0000000..73bde86 --- /dev/null +++ b/schemas/v2/FeedbackUploadResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FeedbackUploadResponse", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FileChangeOutputDeltaNotification.json b/schemas/v2/FileChangeOutputDeltaNotification.json new file mode 100644 index 0000000..0763bb2 --- /dev/null +++ b/schemas/v2/FileChangeOutputDeltaNotification.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangeOutputDeltaNotification", + "description": "Deprecated legacy notification for `apply_patch` textual output.\n\nThe server no longer emits this notification.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FileChangePatchUpdatedNotification.json b/schemas/v2/FileChangePatchUpdatedNotification.json new file mode 100644 index 0000000..b1699f0 --- /dev/null +++ b/schemas/v2/FileChangePatchUpdatedNotification.json @@ -0,0 +1,107 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FileChangePatchUpdatedNotification", + "type": "object", + "required": [ + "changes", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsChangedNotification.json b/schemas/v2/FsChangedNotification.json new file mode 100644 index 0000000..508b911 --- /dev/null +++ b/schemas/v2/FsChangedNotification.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsChangedNotification", + "description": "Filesystem watch notification emitted for `fs/watch` subscribers.", + "type": "object", + "required": [ + "changedPaths", + "watchId" + ], + "properties": { + "changedPaths": { + "description": "File or directory paths associated with this event.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsCopyParams.json b/schemas/v2/FsCopyParams.json new file mode 100644 index 0000000..a6cd706 --- /dev/null +++ b/schemas/v2/FsCopyParams.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyParams", + "description": "Copy a file or directory tree on the host filesystem.", + "type": "object", + "required": [ + "destinationPath", + "sourcePath" + ], + "properties": { + "destinationPath": { + "description": "Absolute destination path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Required for directory copies; ignored for file copies.", + "type": "boolean" + }, + "sourcePath": { + "description": "Absolute source path.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsCopyResponse.json b/schemas/v2/FsCopyResponse.json new file mode 100644 index 0000000..f36e78a --- /dev/null +++ b/schemas/v2/FsCopyResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCopyResponse", + "description": "Successful response for `fs/copy`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/FsCreateDirectoryParams.json b/schemas/v2/FsCreateDirectoryParams.json new file mode 100644 index 0000000..9d3afb5 --- /dev/null +++ b/schemas/v2/FsCreateDirectoryParams.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryParams", + "description": "Create a directory on the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to create.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether parent directories should also be created. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsCreateDirectoryResponse.json b/schemas/v2/FsCreateDirectoryResponse.json new file mode 100644 index 0000000..b822f1a --- /dev/null +++ b/schemas/v2/FsCreateDirectoryResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsCreateDirectoryResponse", + "description": "Successful response for `fs/createDirectory`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/FsGetMetadataParams.json b/schemas/v2/FsGetMetadataParams.json new file mode 100644 index 0000000..f8c8ce0 --- /dev/null +++ b/schemas/v2/FsGetMetadataParams.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataParams", + "description": "Request metadata for an absolute path.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to inspect.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsGetMetadataResponse.json b/schemas/v2/FsGetMetadataResponse.json new file mode 100644 index 0000000..386d248 --- /dev/null +++ b/schemas/v2/FsGetMetadataResponse.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsGetMetadataResponse", + "description": "Metadata returned by `fs/getMetadata`.", + "type": "object", + "required": [ + "createdAtMs", + "isDirectory", + "isFile", + "isSymlink", + "modifiedAtMs" + ], + "properties": { + "createdAtMs": { + "description": "File creation time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + }, + "isDirectory": { + "description": "Whether the path resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether the path resolves to a regular file.", + "type": "boolean" + }, + "isSymlink": { + "description": "Whether the path itself is a symbolic link.", + "type": "boolean" + }, + "modifiedAtMs": { + "description": "File modification time in Unix milliseconds when available, otherwise `0`.", + "type": "integer", + "format": "int64" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsReadDirectoryParams.json b/schemas/v2/FsReadDirectoryParams.json new file mode 100644 index 0000000..e454f26 --- /dev/null +++ b/schemas/v2/FsReadDirectoryParams.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryParams", + "description": "List direct child names for a directory.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute directory path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsReadDirectoryResponse.json b/schemas/v2/FsReadDirectoryResponse.json new file mode 100644 index 0000000..9e98fbe --- /dev/null +++ b/schemas/v2/FsReadDirectoryResponse.json @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadDirectoryResponse", + "description": "Directory entries returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "entries" + ], + "properties": { + "entries": { + "description": "Direct child entries in the requested directory.", + "type": "array", + "items": { + "$ref": "#/definitions/FsReadDirectoryEntry" + } + } + }, + "definitions": { + "FsReadDirectoryEntry": { + "description": "A directory entry returned by `fs/readDirectory`.", + "type": "object", + "required": [ + "fileName", + "isDirectory", + "isFile" + ], + "properties": { + "fileName": { + "description": "Direct child entry name only, not an absolute or relative path.", + "type": "string" + }, + "isDirectory": { + "description": "Whether this entry resolves to a directory.", + "type": "boolean" + }, + "isFile": { + "description": "Whether this entry resolves to a regular file.", + "type": "boolean" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsReadFileParams.json b/schemas/v2/FsReadFileParams.json new file mode 100644 index 0000000..64074e2 --- /dev/null +++ b/schemas/v2/FsReadFileParams.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileParams", + "description": "Read a file from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Absolute path to read.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsReadFileResponse.json b/schemas/v2/FsReadFileResponse.json new file mode 100644 index 0000000..1e7a6a3 --- /dev/null +++ b/schemas/v2/FsReadFileResponse.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsReadFileResponse", + "description": "Base64-encoded file contents returned by `fs/readFile`.", + "type": "object", + "required": [ + "dataBase64" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsRemoveParams.json b/schemas/v2/FsRemoveParams.json new file mode 100644 index 0000000..bc40726 --- /dev/null +++ b/schemas/v2/FsRemoveParams.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveParams", + "description": "Remove a file or directory tree from the host filesystem.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "force": { + "description": "Whether missing paths should be ignored. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + }, + "path": { + "description": "Absolute path to remove.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "recursive": { + "description": "Whether directory removal should recurse. Defaults to `true`.", + "type": [ + "boolean", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsRemoveResponse.json b/schemas/v2/FsRemoveResponse.json new file mode 100644 index 0000000..b52829f --- /dev/null +++ b/schemas/v2/FsRemoveResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsRemoveResponse", + "description": "Successful response for `fs/remove`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/FsUnwatchParams.json b/schemas/v2/FsUnwatchParams.json new file mode 100644 index 0000000..137d86d --- /dev/null +++ b/schemas/v2/FsUnwatchParams.json @@ -0,0 +1,15 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchParams", + "description": "Stop filesystem watch notifications for a prior `fs/watch`.", + "type": "object", + "required": [ + "watchId" + ], + "properties": { + "watchId": { + "description": "Watch identifier previously provided to `fs/watch`.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsUnwatchResponse.json b/schemas/v2/FsUnwatchResponse.json new file mode 100644 index 0000000..1cf264c --- /dev/null +++ b/schemas/v2/FsUnwatchResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsUnwatchResponse", + "description": "Successful response for `fs/unwatch`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/FsWatchParams.json b/schemas/v2/FsWatchParams.json new file mode 100644 index 0000000..4ee07ba --- /dev/null +++ b/schemas/v2/FsWatchParams.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchParams", + "description": "Start filesystem watch notifications for an absolute path.", + "type": "object", + "required": [ + "path", + "watchId" + ], + "properties": { + "path": { + "description": "Absolute file or directory path to watch.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "watchId": { + "description": "Connection-scoped watch identifier used for `fs/unwatch` and `fs/changed`.", + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsWatchResponse.json b/schemas/v2/FsWatchResponse.json new file mode 100644 index 0000000..b3cce43 --- /dev/null +++ b/schemas/v2/FsWatchResponse.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWatchResponse", + "description": "Successful response for `fs/watch`.", + "type": "object", + "required": [ + "path" + ], + "properties": { + "path": { + "description": "Canonicalized path associated with the watch.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsWriteFileParams.json b/schemas/v2/FsWriteFileParams.json new file mode 100644 index 0000000..774c190 --- /dev/null +++ b/schemas/v2/FsWriteFileParams.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileParams", + "description": "Write a file on the host filesystem.", + "type": "object", + "required": [ + "dataBase64", + "path" + ], + "properties": { + "dataBase64": { + "description": "File contents encoded as base64.", + "type": "string" + }, + "path": { + "description": "Absolute path to write.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/FsWriteFileResponse.json b/schemas/v2/FsWriteFileResponse.json new file mode 100644 index 0000000..ba9a84f --- /dev/null +++ b/schemas/v2/FsWriteFileResponse.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "FsWriteFileResponse", + "description": "Successful response for `fs/writeFile`.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/GetAccountParams.json b/schemas/v2/GetAccountParams.json new file mode 100644 index 0000000..f5ea18d --- /dev/null +++ b/schemas/v2/GetAccountParams.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountParams", + "type": "object", + "properties": { + "refreshToken": { + "description": "When `true`, requests a proactive token refresh before returning.\n\nIn managed auth mode this triggers the normal refresh-token flow. In external auth mode this flag is ignored. Clients should refresh tokens themselves and call `account/login/start` with `chatgptAuthTokens`.", + "default": false, + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/GetAccountRateLimitsResponse.json b/schemas/v2/GetAccountRateLimitsResponse.json new file mode 100644 index 0000000..0f0a327 --- /dev/null +++ b/schemas/v2/GetAccountRateLimitsResponse.json @@ -0,0 +1,171 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountRateLimitsResponse", + "type": "object", + "required": [ + "rateLimits" + ], + "properties": { + "rateLimits": { + "description": "Backward-compatible single-bucket view; mirrors the historical payload.", + "allOf": [ + { + "$ref": "#/definitions/RateLimitSnapshot" + } + ] + }, + "rateLimitsByLimitId": { + "description": "Multi-bucket view keyed by metered `limit_id` (for example, `codex`).", + "type": [ + "object", + "null" + ], + "additionalProperties": { + "$ref": "#/definitions/RateLimitSnapshot" + } + } + }, + "definitions": { + "CreditsSnapshot": { + "type": "object", + "required": [ + "hasCredits", + "unlimited" + ], + "properties": { + "balance": { + "type": [ + "string", + "null" + ] + }, + "hasCredits": { + "type": "boolean" + }, + "unlimited": { + "type": "boolean" + } + } + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + }, + "RateLimitReachedType": { + "type": "string", + "enum": [ + "rate_limit_reached", + "workspace_owner_credits_depleted", + "workspace_member_credits_depleted", + "workspace_owner_usage_limit_reached", + "workspace_member_usage_limit_reached" + ] + }, + "RateLimitSnapshot": { + "type": "object", + "properties": { + "credits": { + "anyOf": [ + { + "$ref": "#/definitions/CreditsSnapshot" + }, + { + "type": "null" + } + ] + }, + "limitId": { + "type": [ + "string", + "null" + ] + }, + "limitName": { + "type": [ + "string", + "null" + ] + }, + "planType": { + "anyOf": [ + { + "$ref": "#/definitions/PlanType" + }, + { + "type": "null" + } + ] + }, + "primary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + }, + "rateLimitReachedType": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitReachedType" + }, + { + "type": "null" + } + ] + }, + "secondary": { + "anyOf": [ + { + "$ref": "#/definitions/RateLimitWindow" + }, + { + "type": "null" + } + ] + } + } + }, + "RateLimitWindow": { + "type": "object", + "required": [ + "usedPercent" + ], + "properties": { + "resetsAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "usedPercent": { + "type": "integer", + "format": "int32" + }, + "windowDurationMins": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/GetAccountResponse.json b/schemas/v2/GetAccountResponse.json new file mode 100644 index 0000000..1b29fc0 --- /dev/null +++ b/schemas/v2/GetAccountResponse.json @@ -0,0 +1,102 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GetAccountResponse", + "type": "object", + "required": [ + "requiresOpenaiAuth" + ], + "properties": { + "account": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + }, + "requiresOpenaiAuth": { + "type": "boolean" + } + }, + "definitions": { + "Account": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyAccountType" + } + }, + "title": "ApiKeyAccount" + }, + { + "type": "object", + "required": [ + "email", + "planType", + "type" + ], + "properties": { + "email": { + "type": "string" + }, + "planType": { + "$ref": "#/definitions/PlanType" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "ChatgptAccountType" + } + }, + "title": "ChatgptAccount" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "amazonBedrock" + ], + "title": "AmazonBedrockAccountType" + } + }, + "title": "AmazonBedrockAccount" + } + ] + }, + "PlanType": { + "type": "string", + "enum": [ + "free", + "go", + "plus", + "pro", + "prolite", + "team", + "self_serve_business_usage_based", + "business", + "enterprise_cbp_usage_based", + "enterprise", + "edu", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/GuardianWarningNotification.json b/schemas/v2/GuardianWarningNotification.json new file mode 100644 index 0000000..14608eb --- /dev/null +++ b/schemas/v2/GuardianWarningNotification.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "GuardianWarningNotification", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "description": "Concise guardian warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Thread target for the guardian warning.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/HookCompletedNotification.json b/schemas/v2/HookCompletedNotification.json new file mode 100644 index 0000000..ff57009 --- /dev/null +++ b/schemas/v2/HookCompletedNotification.json @@ -0,0 +1,194 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookCompletedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "displayOrder", + "entries", + "eventName", + "executionMode", + "handlerType", + "id", + "scope", + "sourcePath", + "startedAt", + "status" + ], + "properties": { + "completedAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "durationMs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/HookOutputEntry" + } + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "executionMode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source": { + "default": "unknown", + "allOf": [ + { + "$ref": "#/definitions/HookSource" + } + ] + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "startedAt": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/HookStartedNotification.json b/schemas/v2/HookStartedNotification.json new file mode 100644 index 0000000..67a9556 --- /dev/null +++ b/schemas/v2/HookStartedNotification.json @@ -0,0 +1,194 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HookStartedNotification", + "type": "object", + "required": [ + "run", + "threadId" + ], + "properties": { + "run": { + "$ref": "#/definitions/HookRunSummary" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookExecutionMode": { + "type": "string", + "enum": [ + "sync", + "async" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookOutputEntry": { + "type": "object", + "required": [ + "kind", + "text" + ], + "properties": { + "kind": { + "$ref": "#/definitions/HookOutputEntryKind" + }, + "text": { + "type": "string" + } + } + }, + "HookOutputEntryKind": { + "type": "string", + "enum": [ + "warning", + "stop", + "feedback", + "context", + "error" + ] + }, + "HookRunStatus": { + "type": "string", + "enum": [ + "running", + "completed", + "failed", + "blocked", + "stopped" + ] + }, + "HookRunSummary": { + "type": "object", + "required": [ + "displayOrder", + "entries", + "eventName", + "executionMode", + "handlerType", + "id", + "scope", + "sourcePath", + "startedAt", + "status" + ], + "properties": { + "completedAt": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "durationMs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/HookOutputEntry" + } + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "executionMode": { + "$ref": "#/definitions/HookExecutionMode" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "id": { + "type": "string" + }, + "scope": { + "$ref": "#/definitions/HookScope" + }, + "source": { + "default": "unknown", + "allOf": [ + { + "$ref": "#/definitions/HookSource" + } + ] + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "startedAt": { + "type": "integer", + "format": "int64" + }, + "status": { + "$ref": "#/definitions/HookRunStatus" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookScope": { + "type": "string", + "enum": [ + "thread", + "turn" + ] + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/HooksListParams.json b/schemas/v2/HooksListParams.json new file mode 100644 index 0000000..8efb0b4 --- /dev/null +++ b/schemas/v2/HooksListParams.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/HooksListResponse.json b/schemas/v2/HooksListResponse.json new file mode 100644 index 0000000..77372f2 --- /dev/null +++ b/schemas/v2/HooksListResponse.json @@ -0,0 +1,192 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "HooksListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/HooksListEntry" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "HookErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "HookHandlerType": { + "type": "string", + "enum": [ + "command", + "prompt", + "agent" + ] + }, + "HookMetadata": { + "type": "object", + "required": [ + "currentHash", + "displayOrder", + "enabled", + "eventName", + "handlerType", + "isManaged", + "key", + "source", + "sourcePath", + "timeoutSec", + "trustStatus" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "currentHash": { + "type": "string" + }, + "displayOrder": { + "type": "integer", + "format": "int64" + }, + "enabled": { + "type": "boolean" + }, + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "handlerType": { + "$ref": "#/definitions/HookHandlerType" + }, + "isManaged": { + "type": "boolean" + }, + "key": { + "type": "string" + }, + "matcher": { + "type": [ + "string", + "null" + ] + }, + "pluginId": { + "type": [ + "string", + "null" + ] + }, + "source": { + "$ref": "#/definitions/HookSource" + }, + "sourcePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "statusMessage": { + "type": [ + "string", + "null" + ] + }, + "timeoutSec": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "trustStatus": { + "$ref": "#/definitions/HookTrustStatus" + } + } + }, + "HookSource": { + "type": "string", + "enum": [ + "system", + "user", + "project", + "mdm", + "sessionFlags", + "plugin", + "cloudRequirements", + "legacyManagedConfigFile", + "legacyManagedConfigMdm", + "unknown" + ] + }, + "HookTrustStatus": { + "type": "string", + "enum": [ + "managed", + "untrusted", + "trusted", + "modified" + ] + }, + "HooksListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "hooks", + "warnings" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/HookErrorInfo" + } + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/HookMetadata" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ItemCompletedNotification.json b/schemas/v2/ItemCompletedNotification.json new file mode 100644 index 0000000..aec6ec7 --- /dev/null +++ b/schemas/v2/ItemCompletedNotification.json @@ -0,0 +1,1425 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemCompletedNotification", + "type": "object", + "required": [ + "completedAtMs", + "item", + "threadId", + "turnId" + ], + "properties": { + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle completed.", + "type": "integer", + "format": "int64" + }, + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ItemGuardianApprovalReviewCompletedNotification.json b/schemas/v2/ItemGuardianApprovalReviewCompletedNotification.json new file mode 100644 index 0000000..ab3a22e --- /dev/null +++ b/schemas/v2/ItemGuardianApprovalReviewCompletedNotification.json @@ -0,0 +1,623 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewCompletedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "completedAtMs", + "decisionSource", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "completedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review completed.", + "type": "integer", + "format": "int64" + }, + "decisionSource": { + "$ref": "#/definitions/AutoReviewDecisionSource" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "AutoReviewDecisionSource": { + "description": "[UNSTABLE] Source that produced a terminal approval auto-review decision.", + "type": "string", + "enum": [ + "agent" + ] + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "GuardianApprovalReview": { + "description": "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "type": "object", + "required": [ + "status" + ], + "properties": { + "rationale": { + "type": [ + "string", + "null" + ] + }, + "riskLevel": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianRiskLevel" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/GuardianApprovalReviewStatus" + }, + "userAuthorization": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianUserAuthorization" + }, + { + "type": "null" + } + ] + } + } + }, + "GuardianApprovalReviewAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "cwd", + "source", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandGuardianApprovalReviewActionType" + } + }, + "title": "CommandGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "argv", + "cwd", + "program", + "source", + "type" + ], + "properties": { + "argv": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "program": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "execve" + ], + "title": "ExecveGuardianApprovalReviewActionType" + } + }, + "title": "ExecveGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "cwd", + "files", + "type" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "applyPatch" + ], + "title": "ApplyPatchGuardianApprovalReviewActionType" + } + }, + "title": "ApplyPatchGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "host", + "port", + "protocol", + "target", + "type" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + }, + "target": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "networkAccess" + ], + "title": "NetworkAccessGuardianApprovalReviewActionType" + } + }, + "title": "NetworkAccessGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "server", + "toolName", + "type" + ], + "properties": { + "connectorId": { + "type": [ + "string", + "null" + ] + }, + "connectorName": { + "type": [ + "string", + "null" + ] + }, + "server": { + "type": "string" + }, + "toolName": { + "type": "string" + }, + "toolTitle": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallGuardianApprovalReviewActionType" + } + }, + "title": "McpToolCallGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "permissions", + "type" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "requestPermissions" + ], + "title": "RequestPermissionsGuardianApprovalReviewActionType" + } + }, + "title": "RequestPermissionsGuardianApprovalReviewAction" + } + ] + }, + "GuardianApprovalReviewStatus": { + "description": "[UNSTABLE] Lifecycle state for an approval auto-review.", + "type": "string", + "enum": [ + "inProgress", + "approved", + "denied", + "timedOut", + "aborted" + ] + }, + "GuardianCommandSource": { + "type": "string", + "enum": [ + "shell", + "unifiedExec" + ] + }, + "GuardianRiskLevel": { + "description": "[UNSTABLE] Risk level assigned by approval auto-review.", + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "GuardianUserAuthorization": { + "description": "[UNSTABLE] Authorization level assigned by approval auto-review.", + "type": "string", + "enum": [ + "unknown", + "low", + "medium", + "high" + ] + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/v2/ItemGuardianApprovalReviewStartedNotification.json b/schemas/v2/ItemGuardianApprovalReviewStartedNotification.json new file mode 100644 index 0000000..a3d4723 --- /dev/null +++ b/schemas/v2/ItemGuardianApprovalReviewStartedNotification.json @@ -0,0 +1,606 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemGuardianApprovalReviewStartedNotification", + "description": "[UNSTABLE] Temporary notification payload for approval auto-review. This shape is expected to change soon.", + "type": "object", + "required": [ + "action", + "review", + "reviewId", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "action": { + "$ref": "#/definitions/GuardianApprovalReviewAction" + }, + "review": { + "$ref": "#/definitions/GuardianApprovalReview" + }, + "reviewId": { + "description": "Stable identifier for this review.", + "type": "string" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this review started.", + "type": "integer", + "format": "int64" + }, + "targetItemId": { + "description": "Identifier for the reviewed item or tool call when one exists.\n\nIn most cases, one review maps to one target item. The exceptions are - execve reviews, where a single command may contain multiple execve calls to review (only possible when using the shell_zsh_fork feature) - network policy reviews, where there is no target item\n\nA network call is triggered by a CommandExecution item, so having a target_item_id set to the CommandExecution item would be misleading because the review is about the network call, not the command execution. Therefore, target_item_id is set to None for network policy reviews.", + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AdditionalFileSystemPermissions": { + "type": "object", + "properties": { + "entries": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/FileSystemSandboxEntry" + } + }, + "globScanMaxDepth": { + "type": [ + "integer", + "null" + ], + "format": "uint", + "minimum": 1.0 + }, + "read": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "write": { + "description": "This will be removed in favor of `entries`.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + } + }, + "AdditionalNetworkPermissions": { + "type": "object", + "properties": { + "enabled": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "FileSystemAccessMode": { + "type": "string", + "enum": [ + "read", + "write", + "none" + ] + }, + "FileSystemPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "path" + ], + "title": "PathFileSystemPathType" + } + }, + "title": "PathFileSystemPath" + }, + { + "type": "object", + "required": [ + "pattern", + "type" + ], + "properties": { + "pattern": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "glob_pattern" + ], + "title": "GlobPatternFileSystemPathType" + } + }, + "title": "GlobPatternFileSystemPath" + }, + { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "special" + ], + "title": "SpecialFileSystemPathType" + }, + "value": { + "$ref": "#/definitions/FileSystemSpecialPath" + } + }, + "title": "SpecialFileSystemPath" + } + ] + }, + "FileSystemSandboxEntry": { + "type": "object", + "required": [ + "access", + "path" + ], + "properties": { + "access": { + "$ref": "#/definitions/FileSystemAccessMode" + }, + "path": { + "$ref": "#/definitions/FileSystemPath" + } + } + }, + "FileSystemSpecialPath": { + "oneOf": [ + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "root" + ] + } + }, + "title": "RootFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "minimal" + ] + } + }, + "title": "MinimalFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "project_roots" + ] + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + }, + "title": "KindFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "tmpdir" + ] + } + }, + "title": "TmpdirFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "slash_tmp" + ] + } + }, + "title": "SlashTmpFileSystemSpecialPath" + }, + { + "type": "object", + "required": [ + "kind", + "path" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "path": { + "type": "string" + }, + "subpath": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "GuardianApprovalReview": { + "description": "[UNSTABLE] Temporary approval auto-review payload used by `item/autoApprovalReview/*` notifications. This shape is expected to change soon.", + "type": "object", + "required": [ + "status" + ], + "properties": { + "rationale": { + "type": [ + "string", + "null" + ] + }, + "riskLevel": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianRiskLevel" + }, + { + "type": "null" + } + ] + }, + "status": { + "$ref": "#/definitions/GuardianApprovalReviewStatus" + }, + "userAuthorization": { + "anyOf": [ + { + "$ref": "#/definitions/GuardianUserAuthorization" + }, + { + "type": "null" + } + ] + } + } + }, + "GuardianApprovalReviewAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "cwd", + "source", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "command" + ], + "title": "CommandGuardianApprovalReviewActionType" + } + }, + "title": "CommandGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "argv", + "cwd", + "program", + "source", + "type" + ], + "properties": { + "argv": { + "type": "array", + "items": { + "type": "string" + } + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "program": { + "type": "string" + }, + "source": { + "$ref": "#/definitions/GuardianCommandSource" + }, + "type": { + "type": "string", + "enum": [ + "execve" + ], + "title": "ExecveGuardianApprovalReviewActionType" + } + }, + "title": "ExecveGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "cwd", + "files", + "type" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "type": { + "type": "string", + "enum": [ + "applyPatch" + ], + "title": "ApplyPatchGuardianApprovalReviewActionType" + } + }, + "title": "ApplyPatchGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "host", + "port", + "protocol", + "target", + "type" + ], + "properties": { + "host": { + "type": "string" + }, + "port": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "protocol": { + "$ref": "#/definitions/NetworkApprovalProtocol" + }, + "target": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "networkAccess" + ], + "title": "NetworkAccessGuardianApprovalReviewActionType" + } + }, + "title": "NetworkAccessGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "server", + "toolName", + "type" + ], + "properties": { + "connectorId": { + "type": [ + "string", + "null" + ] + }, + "connectorName": { + "type": [ + "string", + "null" + ] + }, + "server": { + "type": "string" + }, + "toolName": { + "type": "string" + }, + "toolTitle": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallGuardianApprovalReviewActionType" + } + }, + "title": "McpToolCallGuardianApprovalReviewAction" + }, + { + "type": "object", + "required": [ + "permissions", + "type" + ], + "properties": { + "permissions": { + "$ref": "#/definitions/RequestPermissionProfile" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "requestPermissions" + ], + "title": "RequestPermissionsGuardianApprovalReviewActionType" + } + }, + "title": "RequestPermissionsGuardianApprovalReviewAction" + } + ] + }, + "GuardianApprovalReviewStatus": { + "description": "[UNSTABLE] Lifecycle state for an approval auto-review.", + "type": "string", + "enum": [ + "inProgress", + "approved", + "denied", + "timedOut", + "aborted" + ] + }, + "GuardianCommandSource": { + "type": "string", + "enum": [ + "shell", + "unifiedExec" + ] + }, + "GuardianRiskLevel": { + "description": "[UNSTABLE] Risk level assigned by approval auto-review.", + "type": "string", + "enum": [ + "low", + "medium", + "high", + "critical" + ] + }, + "GuardianUserAuthorization": { + "description": "[UNSTABLE] Authorization level assigned by approval auto-review.", + "type": "string", + "enum": [ + "unknown", + "low", + "medium", + "high" + ] + }, + "NetworkApprovalProtocol": { + "type": "string", + "enum": [ + "http", + "https", + "socks5Tcp", + "socks5Udp" + ] + }, + "RequestPermissionProfile": { + "type": "object", + "properties": { + "fileSystem": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalFileSystemPermissions" + }, + { + "type": "null" + } + ] + }, + "network": { + "anyOf": [ + { + "$ref": "#/definitions/AdditionalNetworkPermissions" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/v2/ItemStartedNotification.json b/schemas/v2/ItemStartedNotification.json new file mode 100644 index 0000000..65b0d3c --- /dev/null +++ b/schemas/v2/ItemStartedNotification.json @@ -0,0 +1,1425 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ItemStartedNotification", + "type": "object", + "required": [ + "item", + "startedAtMs", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/ThreadItem" + }, + "startedAtMs": { + "description": "Unix timestamp (in milliseconds) when this item lifecycle started.", + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ListMcpServerStatusParams.json b/schemas/v2/ListMcpServerStatusParams.json new file mode 100644 index 0000000..ca6c749 --- /dev/null +++ b/schemas/v2/ListMcpServerStatusParams.json @@ -0,0 +1,43 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "detail": { + "description": "Controls how much MCP inventory data to fetch for each server. Defaults to `Full` when omitted.", + "anyOf": [ + { + "$ref": "#/definitions/McpServerStatusDetail" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a server-defined value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + }, + "definitions": { + "McpServerStatusDetail": { + "type": "string", + "enum": [ + "full", + "toolsAndAuthOnly" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ListMcpServerStatusResponse.json b/schemas/v2/ListMcpServerStatusResponse.json new file mode 100644 index 0000000..5f129f8 --- /dev/null +++ b/schemas/v2/ListMcpServerStatusResponse.json @@ -0,0 +1,191 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ListMcpServerStatusResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/McpServerStatus" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "McpAuthStatus": { + "type": "string", + "enum": [ + "unsupported", + "notLoggedIn", + "bearerToken", + "oAuth" + ] + }, + "McpServerStatus": { + "type": "object", + "required": [ + "authStatus", + "name", + "resourceTemplates", + "resources", + "tools" + ], + "properties": { + "authStatus": { + "$ref": "#/definitions/McpAuthStatus" + }, + "name": { + "type": "string" + }, + "resourceTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceTemplate" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "tools": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Tool" + } + } + } + }, + "Resource": { + "description": "A known resource that the server is capable of reading.", + "type": "object", + "required": [ + "name", + "uri" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "size": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } + }, + "ResourceTemplate": { + "description": "A template description for resources available on the server.", + "type": "object", + "required": [ + "name", + "uriTemplate" + ], + "properties": { + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "uriTemplate": { + "type": "string" + } + } + }, + "Tool": { + "description": "Definition for a tool the client can call.", + "type": "object", + "required": [ + "inputSchema", + "name" + ], + "properties": { + "_meta": true, + "annotations": true, + "description": { + "type": [ + "string", + "null" + ] + }, + "icons": { + "type": [ + "array", + "null" + ], + "items": true + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "outputSchema": true, + "title": { + "type": [ + "string", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/LoginAccountParams.json b/schemas/v2/LoginAccountParams.json new file mode 100644 index 0000000..cf8b4f7 --- /dev/null +++ b/schemas/v2/LoginAccountParams.json @@ -0,0 +1,95 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountParams", + "oneOf": [ + { + "type": "object", + "required": [ + "apiKey", + "type" + ], + "properties": { + "apiKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountParamsType" + } + }, + "title": "ApiKeyv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "codexStreamlinedLogin": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountParamsType" + } + }, + "title": "Chatgptv2::LoginAccountParams" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountParamsType" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountParams" + }, + { + "description": "[UNSTABLE] FOR OPENAI INTERNAL USE ONLY - DO NOT USE. The access token must contain the same scopes that Codex-managed ChatGPT auth tokens have.", + "type": "object", + "required": [ + "accessToken", + "chatgptAccountId", + "type" + ], + "properties": { + "accessToken": { + "description": "Access token (JWT) supplied by the client. This token is used for backend API requests and email extraction.", + "type": "string" + }, + "chatgptAccountId": { + "description": "Workspace/account identifier supplied by the client.", + "type": "string" + }, + "chatgptPlanType": { + "description": "Optional plan type supplied by the client.\n\nWhen `null`, Codex attempts to derive the plan type from access-token claims. If unavailable, the plan defaults to `unknown`.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountParamsType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountParams" + } + ] +} \ No newline at end of file diff --git a/schemas/v2/LoginAccountResponse.json b/schemas/v2/LoginAccountResponse.json new file mode 100644 index 0000000..b98fb05 --- /dev/null +++ b/schemas/v2/LoginAccountResponse.json @@ -0,0 +1,93 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LoginAccountResponse", + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apiKey" + ], + "title": "ApiKeyv2::LoginAccountResponseType" + } + }, + "title": "ApiKeyv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "authUrl", + "loginId", + "type" + ], + "properties": { + "authUrl": { + "description": "URL the client should open in a browser to initiate the OAuth flow.", + "type": "string" + }, + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgpt" + ], + "title": "Chatgptv2::LoginAccountResponseType" + } + }, + "title": "Chatgptv2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "loginId", + "type", + "userCode", + "verificationUrl" + ], + "properties": { + "loginId": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "chatgptDeviceCode" + ], + "title": "ChatgptDeviceCodev2::LoginAccountResponseType" + }, + "userCode": { + "description": "One-time code the user must enter after signing in.", + "type": "string" + }, + "verificationUrl": { + "description": "URL the client should open in a browser to complete device code authorization.", + "type": "string" + } + }, + "title": "ChatgptDeviceCodev2::LoginAccountResponse" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "chatgptAuthTokens" + ], + "title": "ChatgptAuthTokensv2::LoginAccountResponseType" + } + }, + "title": "ChatgptAuthTokensv2::LoginAccountResponse" + } + ] +} \ No newline at end of file diff --git a/schemas/v2/LogoutAccountResponse.json b/schemas/v2/LogoutAccountResponse.json new file mode 100644 index 0000000..56415a0 --- /dev/null +++ b/schemas/v2/LogoutAccountResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "LogoutAccountResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceAddParams.json b/schemas/v2/MarketplaceAddParams.json new file mode 100644 index 0000000..94bb990 --- /dev/null +++ b/schemas/v2/MarketplaceAddParams.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddParams", + "type": "object", + "required": [ + "source" + ], + "properties": { + "refName": { + "type": [ + "string", + "null" + ] + }, + "source": { + "type": "string" + }, + "sparsePaths": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceAddResponse.json b/schemas/v2/MarketplaceAddResponse.json new file mode 100644 index 0000000..add058d --- /dev/null +++ b/schemas/v2/MarketplaceAddResponse.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceAddResponse", + "type": "object", + "required": [ + "alreadyAdded", + "installedRoot", + "marketplaceName" + ], + "properties": { + "alreadyAdded": { + "type": "boolean" + }, + "installedRoot": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "marketplaceName": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceRemoveParams.json b/schemas/v2/MarketplaceRemoveParams.json new file mode 100644 index 0000000..61c2a7c --- /dev/null +++ b/schemas/v2/MarketplaceRemoveParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveParams", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "marketplaceName": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceRemoveResponse.json b/schemas/v2/MarketplaceRemoveResponse.json new file mode 100644 index 0000000..fcd31ab --- /dev/null +++ b/schemas/v2/MarketplaceRemoveResponse.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceRemoveResponse", + "type": "object", + "required": [ + "marketplaceName" + ], + "properties": { + "installedRoot": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "marketplaceName": { + "type": "string" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceUpgradeParams.json b/schemas/v2/MarketplaceUpgradeParams.json new file mode 100644 index 0000000..d6f7b7c --- /dev/null +++ b/schemas/v2/MarketplaceUpgradeParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeParams", + "type": "object", + "properties": { + "marketplaceName": { + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/MarketplaceUpgradeResponse.json b/schemas/v2/MarketplaceUpgradeResponse.json new file mode 100644 index 0000000..e051b1e --- /dev/null +++ b/schemas/v2/MarketplaceUpgradeResponse.json @@ -0,0 +1,51 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketplaceUpgradeResponse", + "type": "object", + "required": [ + "errors", + "selectedMarketplaces", + "upgradedRoots" + ], + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceUpgradeErrorInfo" + } + }, + "selectedMarketplaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "upgradedRoots": { + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "MarketplaceUpgradeErrorInfo": { + "type": "object", + "required": [ + "marketplaceName", + "message" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpResourceReadParams.json b/schemas/v2/McpResourceReadParams.json new file mode 100644 index 0000000..9fc87fd --- /dev/null +++ b/schemas/v2/McpResourceReadParams.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadParams", + "type": "object", + "required": [ + "server", + "uri" + ], + "properties": { + "server": { + "type": "string" + }, + "threadId": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpResourceReadResponse.json b/schemas/v2/McpResourceReadResponse.json new file mode 100644 index 0000000..4bd9d22 --- /dev/null +++ b/schemas/v2/McpResourceReadResponse.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpResourceReadResponse", + "type": "object", + "required": [ + "contents" + ], + "properties": { + "contents": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceContent" + } + } + }, + "definitions": { + "ResourceContent": { + "description": "Contents returned when reading a resource from an MCP server.", + "anyOf": [ + { + "type": "object", + "required": [ + "text", + "uri" + ], + "properties": { + "_meta": true, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "text": { + "type": "string" + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + }, + { + "type": "object", + "required": [ + "blob", + "uri" + ], + "properties": { + "_meta": true, + "blob": { + "type": "string" + }, + "mimeType": { + "type": [ + "string", + "null" + ] + }, + "uri": { + "description": "The URI of this resource.", + "type": "string" + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerOauthLoginCompletedNotification.json b/schemas/v2/McpServerOauthLoginCompletedNotification.json new file mode 100644 index 0000000..3a89236 --- /dev/null +++ b/schemas/v2/McpServerOauthLoginCompletedNotification.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginCompletedNotification", + "type": "object", + "required": [ + "name", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "success": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerOauthLoginParams.json b/schemas/v2/McpServerOauthLoginParams.json new file mode 100644 index 0000000..0c7343c --- /dev/null +++ b/schemas/v2/McpServerOauthLoginParams.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginParams", + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "scopes": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "timeoutSecs": { + "type": [ + "integer", + "null" + ], + "format": "int64" + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerOauthLoginResponse.json b/schemas/v2/McpServerOauthLoginResponse.json new file mode 100644 index 0000000..d65af19 --- /dev/null +++ b/schemas/v2/McpServerOauthLoginResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerOauthLoginResponse", + "type": "object", + "required": [ + "authorizationUrl" + ], + "properties": { + "authorizationUrl": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerRefreshResponse.json b/schemas/v2/McpServerRefreshResponse.json new file mode 100644 index 0000000..779192e --- /dev/null +++ b/schemas/v2/McpServerRefreshResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerRefreshResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/McpServerStatusUpdatedNotification.json b/schemas/v2/McpServerStatusUpdatedNotification.json new file mode 100644 index 0000000..9e2708c --- /dev/null +++ b/schemas/v2/McpServerStatusUpdatedNotification.json @@ -0,0 +1,34 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerStatusUpdatedNotification", + "type": "object", + "required": [ + "name", + "status" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpServerStartupState" + } + }, + "definitions": { + "McpServerStartupState": { + "type": "string", + "enum": [ + "starting", + "ready", + "failed", + "cancelled" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerToolCallParams.json b/schemas/v2/McpServerToolCallParams.json new file mode 100644 index 0000000..bc1de9c --- /dev/null +++ b/schemas/v2/McpServerToolCallParams.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallParams", + "type": "object", + "required": [ + "server", + "threadId", + "tool" + ], + "properties": { + "_meta": true, + "arguments": true, + "server": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "tool": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/McpServerToolCallResponse.json b/schemas/v2/McpServerToolCallResponse.json new file mode 100644 index 0000000..2fedb1e --- /dev/null +++ b/schemas/v2/McpServerToolCallResponse.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpServerToolCallResponse", + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "isError": { + "type": [ + "boolean", + "null" + ] + }, + "structuredContent": true + } +} \ No newline at end of file diff --git a/schemas/v2/McpToolCallProgressNotification.json b/schemas/v2/McpToolCallProgressNotification.json new file mode 100644 index 0000000..ce627dc --- /dev/null +++ b/schemas/v2/McpToolCallProgressNotification.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "McpToolCallProgressNotification", + "type": "object", + "required": [ + "itemId", + "message", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ModelListParams.json b/schemas/v2/ModelListParams.json new file mode 100644 index 0000000..cd7bb25 --- /dev/null +++ b/schemas/v2/ModelListParams.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "includeHidden": { + "description": "When true, include models that are hidden from the default picker list.", + "type": [ + "boolean", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } +} \ No newline at end of file diff --git a/schemas/v2/ModelListResponse.json b/schemas/v2/ModelListResponse.json new file mode 100644 index 0000000..9d67a1a --- /dev/null +++ b/schemas/v2/ModelListResponse.json @@ -0,0 +1,227 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Model" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. If None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "InputModality": { + "description": "Canonical user-input modality tags advertised by a model.", + "oneOf": [ + { + "description": "Plain text turns and tool payloads.", + "type": "string", + "enum": [ + "text" + ] + }, + { + "description": "Image attachments included in user turns.", + "type": "string", + "enum": [ + "image" + ] + } + ] + }, + "Model": { + "type": "object", + "required": [ + "defaultReasoningEffort", + "description", + "displayName", + "hidden", + "id", + "isDefault", + "model", + "supportedReasoningEfforts" + ], + "properties": { + "additionalSpeedTiers": { + "description": "Deprecated: use `serviceTiers` instead.", + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "availabilityNux": { + "anyOf": [ + { + "$ref": "#/definitions/ModelAvailabilityNux" + }, + { + "type": "null" + } + ] + }, + "defaultReasoningEffort": { + "$ref": "#/definitions/ReasoningEffort" + }, + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "hidden": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "inputModalities": { + "default": [ + "text", + "image" + ], + "type": "array", + "items": { + "$ref": "#/definitions/InputModality" + } + }, + "isDefault": { + "type": "boolean" + }, + "model": { + "type": "string" + }, + "serviceTiers": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/ModelServiceTier" + } + }, + "supportedReasoningEfforts": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningEffortOption" + } + }, + "supportsPersonality": { + "default": false, + "type": "boolean" + }, + "upgrade": { + "type": [ + "string", + "null" + ] + }, + "upgradeInfo": { + "anyOf": [ + { + "$ref": "#/definitions/ModelUpgradeInfo" + }, + { + "type": "null" + } + ] + } + } + }, + "ModelAvailabilityNux": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "ModelServiceTier": { + "type": "object", + "required": [ + "description", + "id", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "ModelUpgradeInfo": { + "type": "object", + "required": [ + "model" + ], + "properties": { + "migrationMarkdown": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "modelLink": { + "type": [ + "string", + "null" + ] + }, + "upgradeCopy": { + "type": [ + "string", + "null" + ] + } + } + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningEffortOption": { + "type": "object", + "required": [ + "description", + "reasoningEffort" + ], + "properties": { + "description": { + "type": "string" + }, + "reasoningEffort": { + "$ref": "#/definitions/ReasoningEffort" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ModelProviderCapabilitiesReadParams.json b/schemas/v2/ModelProviderCapabilitiesReadParams.json new file mode 100644 index 0000000..2996bca --- /dev/null +++ b/schemas/v2/ModelProviderCapabilitiesReadParams.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadParams", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ModelProviderCapabilitiesReadResponse.json b/schemas/v2/ModelProviderCapabilitiesReadResponse.json new file mode 100644 index 0000000..a368245 --- /dev/null +++ b/schemas/v2/ModelProviderCapabilitiesReadResponse.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelProviderCapabilitiesReadResponse", + "type": "object", + "required": [ + "imageGeneration", + "namespaceTools", + "webSearch" + ], + "properties": { + "imageGeneration": { + "type": "boolean" + }, + "namespaceTools": { + "type": "boolean" + }, + "webSearch": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ModelReroutedNotification.json b/schemas/v2/ModelReroutedNotification.json new file mode 100644 index 0000000..1de3b92 --- /dev/null +++ b/schemas/v2/ModelReroutedNotification.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelReroutedNotification", + "type": "object", + "required": [ + "fromModel", + "reason", + "threadId", + "toModel", + "turnId" + ], + "properties": { + "fromModel": { + "type": "string" + }, + "reason": { + "$ref": "#/definitions/ModelRerouteReason" + }, + "threadId": { + "type": "string" + }, + "toModel": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "ModelRerouteReason": { + "type": "string", + "enum": [ + "highRiskCyberActivity" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ModelVerificationNotification.json b/schemas/v2/ModelVerificationNotification.json new file mode 100644 index 0000000..1b3271a --- /dev/null +++ b/schemas/v2/ModelVerificationNotification.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ModelVerificationNotification", + "type": "object", + "required": [ + "threadId", + "turnId", + "verifications" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + }, + "verifications": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVerification" + } + } + }, + "definitions": { + "ModelVerification": { + "type": "string", + "enum": [ + "trustedAccessForCyber" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PlanDeltaNotification.json b/schemas/v2/PlanDeltaNotification.json new file mode 100644 index 0000000..baf0c8e --- /dev/null +++ b/schemas/v2/PlanDeltaNotification.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PlanDeltaNotification", + "description": "EXPERIMENTAL - proposed plan streaming deltas for plan items. Clients should not assume concatenated deltas match the completed plan item content.", + "type": "object", + "required": [ + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginInstallParams.json b/schemas/v2/PluginInstallParams.json new file mode 100644 index 0000000..4321df5 --- /dev/null +++ b/schemas/v2/PluginInstallParams.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginInstallResponse.json b/schemas/v2/PluginInstallResponse.json new file mode 100644 index 0000000..21695e0 --- /dev/null +++ b/schemas/v2/PluginInstallResponse.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstallResponse", + "type": "object", + "required": [ + "appsNeedingAuth", + "authPolicy" + ], + "properties": { + "appsNeedingAuth": { + "type": "array", + "items": { + "$ref": "#/definitions/AppSummary" + } + }, + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + } + }, + "definitions": { + "AppSummary": { + "description": "EXPERIMENTAL - app metadata summary for plugin responses.", + "type": "object", + "required": [ + "id", + "name", + "needsAuth" + ], + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "needsAuth": { + "type": "boolean" + } + } + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginInstalledParams.json b/schemas/v2/PluginInstalledParams.json new file mode 100644 index 0000000..867dac6 --- /dev/null +++ b/schemas/v2/PluginInstalledParams.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "installSuggestionPluginNames": { + "description": "Additional uninstalled plugin names that should be returned when present locally. This is used by mention surfaces that intentionally expose install entrypoints.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginInstalledResponse.json b/schemas/v2/PluginInstalledResponse.json new file mode 100644 index 0000000..6bea8ec --- /dev/null +++ b/schemas/v2/PluginInstalledResponse.json @@ -0,0 +1,525 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginInstalledResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginMarketplaceEntry" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "MarketplaceInterface": { + "type": "object", + "properties": { + "displayName": { + "type": [ + "string", + "null" + ] + } + } + }, + "MarketplaceLoadErrorInfo": { + "type": "object", + "required": [ + "marketplacePath", + "message" + ], + "properties": { + "marketplacePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "message": { + "type": "string" + } + } + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginMarketplaceEntry": { + "type": "object", + "required": [ + "name", + "plugins" + ], + "properties": { + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/MarketplaceInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "description": "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugins": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginSummary" + } + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/PluginSource" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginListParams.json b/schemas/v2/PluginListParams.json new file mode 100644 index 0000000..3012ccd --- /dev/null +++ b/schemas/v2/PluginListParams.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListParams", + "type": "object", + "properties": { + "cwds": { + "description": "Optional working directories used to discover repo marketplaces. When omitted, only home-scoped marketplaces and the official curated marketplace are considered.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "marketplaceKinds": { + "description": "Optional marketplace kind filter. When omitted, only local marketplaces are queried, plus the default remote catalog when enabled by feature flag.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginListMarketplaceKind" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "PluginListMarketplaceKind": { + "type": "string", + "enum": [ + "local", + "workspace-directory", + "shared-with-me" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginListResponse.json b/schemas/v2/PluginListResponse.json new file mode 100644 index 0000000..c65486b --- /dev/null +++ b/schemas/v2/PluginListResponse.json @@ -0,0 +1,532 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginListResponse", + "type": "object", + "required": [ + "marketplaces" + ], + "properties": { + "featuredPluginIds": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "marketplaceLoadErrors": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/MarketplaceLoadErrorInfo" + } + }, + "marketplaces": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginMarketplaceEntry" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "MarketplaceInterface": { + "type": "object", + "properties": { + "displayName": { + "type": [ + "string", + "null" + ] + } + } + }, + "MarketplaceLoadErrorInfo": { + "type": "object", + "required": [ + "marketplacePath", + "message" + ], + "properties": { + "marketplacePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "message": { + "type": "string" + } + } + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginMarketplaceEntry": { + "type": "object", + "required": [ + "name", + "plugins" + ], + "properties": { + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/MarketplaceInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "description": "Local marketplace file path when the marketplace is backed by a local file. Remote-only catalog marketplaces do not have a local path.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugins": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginSummary" + } + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/PluginSource" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginReadParams.json b/schemas/v2/PluginReadParams.json new file mode 100644 index 0000000..137f563 --- /dev/null +++ b/schemas/v2/PluginReadParams.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadParams", + "type": "object", + "required": [ + "pluginName" + ], + "properties": { + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "pluginName": { + "type": "string" + }, + "remoteMarketplaceName": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginReadResponse.json b/schemas/v2/PluginReadResponse.json new file mode 100644 index 0000000..a45edd5 --- /dev/null +++ b/schemas/v2/PluginReadResponse.json @@ -0,0 +1,663 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginReadResponse", + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "plugin": { + "$ref": "#/definitions/PluginDetail" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AppSummary": { + "description": "EXPERIMENTAL - app metadata summary for plugin responses.", + "type": "object", + "required": [ + "id", + "name", + "needsAuth" + ], + "properties": { + "description": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "installUrl": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "needsAuth": { + "type": "boolean" + } + } + }, + "HookEventName": { + "type": "string", + "enum": [ + "preToolUse", + "permissionRequest", + "postToolUse", + "preCompact", + "postCompact", + "sessionStart", + "userPromptSubmit", + "stop" + ] + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginDetail": { + "type": "object", + "required": [ + "apps", + "hooks", + "marketplaceName", + "mcpServers", + "skills", + "summary" + ], + "properties": { + "apps": { + "type": "array", + "items": { + "$ref": "#/definitions/AppSummary" + } + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "hooks": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginHookSummary" + } + }, + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mcpServers": { + "type": "array", + "items": { + "type": "string" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillSummary" + } + }, + "summary": { + "$ref": "#/definitions/PluginSummary" + } + } + }, + "PluginHookSummary": { + "type": "object", + "required": [ + "eventName", + "key" + ], + "properties": { + "eventName": { + "$ref": "#/definitions/HookEventName" + }, + "key": { + "type": "string" + } + } + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/PluginSource" + } + } + }, + "SkillInterface": { + "type": "object", + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "iconLarge": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "iconSmall": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "SkillSummary": { + "type": "object", + "required": [ + "description", + "enabled", + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareCheckoutParams.json b/schemas/v2/PluginShareCheckoutParams.json new file mode 100644 index 0000000..674f02f --- /dev/null +++ b/schemas/v2/PluginShareCheckoutParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareCheckoutResponse.json b/schemas/v2/PluginShareCheckoutResponse.json new file mode 100644 index 0000000..de9c330 --- /dev/null +++ b/schemas/v2/PluginShareCheckoutResponse.json @@ -0,0 +1,45 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareCheckoutResponse", + "type": "object", + "required": [ + "marketplaceName", + "marketplacePath", + "pluginId", + "pluginName", + "pluginPath", + "remotePluginId" + ], + "properties": { + "marketplaceName": { + "type": "string" + }, + "marketplacePath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "pluginId": { + "type": "string" + }, + "pluginName": { + "type": "string" + }, + "pluginPath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareDeleteParams.json b/schemas/v2/PluginShareDeleteParams.json new file mode 100644 index 0000000..69d7753 --- /dev/null +++ b/schemas/v2/PluginShareDeleteParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteParams", + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "remotePluginId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareDeleteResponse.json b/schemas/v2/PluginShareDeleteResponse.json new file mode 100644 index 0000000..9506886 --- /dev/null +++ b/schemas/v2/PluginShareDeleteResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareDeleteResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/PluginShareListParams.json b/schemas/v2/PluginShareListParams.json new file mode 100644 index 0000000..101136d --- /dev/null +++ b/schemas/v2/PluginShareListParams.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListParams", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/PluginShareListResponse.json b/schemas/v2/PluginShareListResponse.json new file mode 100644 index 0000000..24e5634 --- /dev/null +++ b/schemas/v2/PluginShareListResponse.json @@ -0,0 +1,474 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginShareListItem" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "PluginAuthPolicy": { + "type": "string", + "enum": [ + "ON_INSTALL", + "ON_USE" + ] + }, + "PluginAvailability": { + "oneOf": [ + { + "type": "string", + "enum": [ + "DISABLED_BY_ADMIN" + ] + }, + { + "description": "Plugin-service currently sends `\"ENABLED\"` for available remote plugins. Codex app-server exposes `\"AVAILABLE\"` in its API; the alias keeps decoding compatible with that upstream response.", + "type": "string", + "enum": [ + "AVAILABLE" + ] + } + ] + }, + "PluginInstallPolicy": { + "type": "string", + "enum": [ + "NOT_AVAILABLE", + "AVAILABLE", + "INSTALLED_BY_DEFAULT" + ] + }, + "PluginInterface": { + "type": "object", + "required": [ + "capabilities", + "screenshotUrls", + "screenshots" + ], + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + } + }, + "category": { + "type": [ + "string", + "null" + ] + }, + "composerIcon": { + "description": "Local composer icon path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "composerIconUrl": { + "description": "Remote composer icon URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "description": "Starter prompts for the plugin. Capped at 3 entries with a maximum of 128 characters per entry.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "developerName": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "logo": { + "description": "Local logo path, resolved from the installed plugin package.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "logoUrl": { + "description": "Remote logo URL from the plugin catalog.", + "type": [ + "string", + "null" + ] + }, + "longDescription": { + "type": [ + "string", + "null" + ] + }, + "privacyPolicyUrl": { + "type": [ + "string", + "null" + ] + }, + "screenshotUrls": { + "description": "Remote screenshot URLs from the plugin catalog.", + "type": "array", + "items": { + "type": "string" + } + }, + "screenshots": { + "description": "Local screenshot paths, resolved from the installed plugin package.", + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + }, + "termsOfServiceUrl": { + "type": [ + "string", + "null" + ] + }, + "websiteUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareContext": { + "type": "object", + "required": [ + "remotePluginId" + ], + "properties": { + "creatorAccountUserId": { + "type": [ + "string", + "null" + ] + }, + "creatorName": { + "type": [ + "string", + "null" + ] + }, + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "remotePluginId": { + "type": "string" + }, + "remoteVersion": { + "description": "Version of the remote shared plugin release when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "sharePrincipals": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + }, + "shareUrl": { + "type": [ + "string", + "null" + ] + } + } + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginShareListItem": { + "type": "object", + "required": [ + "plugin" + ], + "properties": { + "localPluginPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "plugin": { + "$ref": "#/definitions/PluginSummary" + } + } + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginSource": { + "oneOf": [ + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "local" + ], + "title": "LocalPluginSourceType" + } + }, + "title": "LocalPluginSource" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "path": { + "type": [ + "string", + "null" + ] + }, + "refName": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "git" + ], + "title": "GitPluginSourceType" + }, + "url": { + "type": "string" + } + }, + "title": "GitPluginSource" + }, + { + "description": "The plugin is available in the remote catalog. Download metadata is kept server-side and is not exposed through the app-server API.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "remote" + ], + "title": "RemotePluginSourceType" + } + }, + "title": "RemotePluginSource" + } + ] + }, + "PluginSummary": { + "type": "object", + "required": [ + "authPolicy", + "enabled", + "id", + "installPolicy", + "installed", + "name", + "source" + ], + "properties": { + "authPolicy": { + "$ref": "#/definitions/PluginAuthPolicy" + }, + "availability": { + "description": "Availability state for installing and using the plugin.", + "default": "AVAILABLE", + "allOf": [ + { + "$ref": "#/definitions/PluginAvailability" + } + ] + }, + "enabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "installPolicy": { + "$ref": "#/definitions/PluginInstallPolicy" + }, + "installed": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/PluginInterface" + }, + { + "type": "null" + } + ] + }, + "keywords": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "localVersion": { + "description": "Version of the locally materialized plugin package when available.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "remotePluginId": { + "description": "Backend remote plugin identifier when available.", + "type": [ + "string", + "null" + ] + }, + "shareContext": { + "description": "Remote sharing context associated with this plugin when available.", + "anyOf": [ + { + "$ref": "#/definitions/PluginShareContext" + }, + { + "type": "null" + } + ] + }, + "source": { + "$ref": "#/definitions/PluginSource" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareSaveParams.json b/schemas/v2/PluginShareSaveParams.json new file mode 100644 index 0000000..a72ef51 --- /dev/null +++ b/schemas/v2/PluginShareSaveParams.json @@ -0,0 +1,86 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveParams", + "type": "object", + "required": [ + "pluginPath" + ], + "properties": { + "discoverability": { + "anyOf": [ + { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + { + "type": "null" + } + ] + }, + "pluginPath": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "remotePluginId": { + "type": [ + "string", + "null" + ] + }, + "shareTargets": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginShareTarget": { + "type": "object", + "required": [ + "principalId", + "principalType", + "role" + ], + "properties": { + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginShareTargetRole" + } + } + }, + "PluginShareTargetRole": { + "type": "string", + "enum": [ + "reader", + "editor" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareSaveResponse.json b/schemas/v2/PluginShareSaveResponse.json new file mode 100644 index 0000000..738828c --- /dev/null +++ b/schemas/v2/PluginShareSaveResponse.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareSaveResponse", + "type": "object", + "required": [ + "remotePluginId", + "shareUrl" + ], + "properties": { + "remotePluginId": { + "type": "string" + }, + "shareUrl": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareUpdateTargetsParams.json b/schemas/v2/PluginShareUpdateTargetsParams.json new file mode 100644 index 0000000..95f07f4 --- /dev/null +++ b/schemas/v2/PluginShareUpdateTargetsParams.json @@ -0,0 +1,67 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsParams", + "type": "object", + "required": [ + "discoverability", + "remotePluginId", + "shareTargets" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/PluginShareUpdateDiscoverability" + }, + "remotePluginId": { + "type": "string" + }, + "shareTargets": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginShareTarget" + } + } + }, + "definitions": { + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + }, + "PluginShareTarget": { + "type": "object", + "required": [ + "principalId", + "principalType", + "role" + ], + "properties": { + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginShareTargetRole" + } + } + }, + "PluginShareTargetRole": { + "type": "string", + "enum": [ + "reader", + "editor" + ] + }, + "PluginShareUpdateDiscoverability": { + "type": "string", + "enum": [ + "UNLISTED", + "PRIVATE" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginShareUpdateTargetsResponse.json b/schemas/v2/PluginShareUpdateTargetsResponse.json new file mode 100644 index 0000000..5a1d46a --- /dev/null +++ b/schemas/v2/PluginShareUpdateTargetsResponse.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginShareUpdateTargetsResponse", + "type": "object", + "required": [ + "discoverability", + "principals" + ], + "properties": { + "discoverability": { + "$ref": "#/definitions/PluginShareDiscoverability" + }, + "principals": { + "type": "array", + "items": { + "$ref": "#/definitions/PluginSharePrincipal" + } + } + }, + "definitions": { + "PluginShareDiscoverability": { + "type": "string", + "enum": [ + "LISTED", + "UNLISTED", + "PRIVATE" + ] + }, + "PluginSharePrincipal": { + "type": "object", + "required": [ + "name", + "principalId", + "principalType", + "role" + ], + "properties": { + "name": { + "type": "string" + }, + "principalId": { + "type": "string" + }, + "principalType": { + "$ref": "#/definitions/PluginSharePrincipalType" + }, + "role": { + "$ref": "#/definitions/PluginSharePrincipalRole" + } + } + }, + "PluginSharePrincipalRole": { + "type": "string", + "enum": [ + "reader", + "editor", + "owner" + ] + }, + "PluginSharePrincipalType": { + "type": "string", + "enum": [ + "user", + "group", + "workspace" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginSkillReadParams.json b/schemas/v2/PluginSkillReadParams.json new file mode 100644 index 0000000..9a81c13 --- /dev/null +++ b/schemas/v2/PluginSkillReadParams.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadParams", + "type": "object", + "required": [ + "remoteMarketplaceName", + "remotePluginId", + "skillName" + ], + "properties": { + "remoteMarketplaceName": { + "type": "string" + }, + "remotePluginId": { + "type": "string" + }, + "skillName": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginSkillReadResponse.json b/schemas/v2/PluginSkillReadResponse.json new file mode 100644 index 0000000..c953427 --- /dev/null +++ b/schemas/v2/PluginSkillReadResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginSkillReadResponse", + "type": "object", + "properties": { + "contents": { + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginUninstallParams.json b/schemas/v2/PluginUninstallParams.json new file mode 100644 index 0000000..8e3113d --- /dev/null +++ b/schemas/v2/PluginUninstallParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallParams", + "type": "object", + "required": [ + "pluginId" + ], + "properties": { + "pluginId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/PluginUninstallResponse.json b/schemas/v2/PluginUninstallResponse.json new file mode 100644 index 0000000..5c0e37b --- /dev/null +++ b/schemas/v2/PluginUninstallResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "PluginUninstallResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ProcessExitedNotification.json b/schemas/v2/ProcessExitedNotification.json new file mode 100644 index 0000000..39da68a --- /dev/null +++ b/schemas/v2/ProcessExitedNotification.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessExitedNotification", + "description": "Final process exit notification for `process/spawn`.", + "type": "object", + "required": [ + "exitCode", + "processHandle", + "stderr", + "stderrCapReached", + "stdout", + "stdoutCapReached" + ], + "properties": { + "exitCode": { + "description": "Process exit code.", + "type": "integer", + "format": "int32" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stderr": { + "description": "Buffered stderr capture.\n\nEmpty when stderr was streamed via `process/outputDelta`.", + "type": "string" + }, + "stderrCapReached": { + "description": "Whether stderr reached `outputBytesCap`.\n\nIn streaming mode, stderr is empty and cap state is also reported on the final stderr `process/outputDelta` notification.", + "type": "boolean" + }, + "stdout": { + "description": "Buffered stdout capture.\n\nEmpty when stdout was streamed via `process/outputDelta`.", + "type": "string" + }, + "stdoutCapReached": { + "description": "Whether stdout reached `outputBytesCap`.\n\nIn streaming mode, stdout is empty and cap state is also reported on the final stdout `process/outputDelta` notification.", + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ProcessOutputDeltaNotification.json b/schemas/v2/ProcessOutputDeltaNotification.json new file mode 100644 index 0000000..f29bdd4 --- /dev/null +++ b/schemas/v2/ProcessOutputDeltaNotification.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ProcessOutputDeltaNotification", + "description": "Base64-encoded output chunk emitted for a streaming `process/spawn` request.", + "type": "object", + "required": [ + "capReached", + "deltaBase64", + "processHandle", + "stream" + ], + "properties": { + "capReached": { + "description": "True on the final streamed chunk for this stream when output was truncated by `outputBytesCap`.", + "type": "boolean" + }, + "deltaBase64": { + "description": "Base64-encoded output bytes.", + "type": "string" + }, + "processHandle": { + "description": "Client-supplied, connection-scoped `processHandle` from `process/spawn`.", + "type": "string" + }, + "stream": { + "description": "Output stream this chunk belongs to.", + "allOf": [ + { + "$ref": "#/definitions/ProcessOutputStream" + } + ] + } + }, + "definitions": { + "ProcessOutputStream": { + "description": "Stream label for `process/outputDelta` notifications.", + "oneOf": [ + { + "description": "stdout stream. PTY mode multiplexes terminal output here.", + "type": "string", + "enum": [ + "stdout" + ] + }, + { + "description": "stderr stream.", + "type": "string", + "enum": [ + "stderr" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/RawResponseItemCompletedNotification.json b/schemas/v2/RawResponseItemCompletedNotification.json new file mode 100644 index 0000000..997f18a --- /dev/null +++ b/schemas/v2/RawResponseItemCompletedNotification.json @@ -0,0 +1,909 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawResponseItemCompletedNotification", + "type": "object", + "required": [ + "item", + "threadId", + "turnId" + ], + "properties": { + "item": { + "$ref": "#/definitions/ResponseItem" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType" + } + }, + "title": "InputTextContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType" + } + }, + "title": "InputImageContentItem" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType" + } + }, + "title": "OutputTextContentItem" + } + ] + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType" + } + }, + "title": "InputTextFunctionCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType" + } + }, + "title": "InputImageFunctionCallOutputContentItem" + } + ] + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "title": "ExecLocalShellAction" + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType" + } + }, + "title": "ReasoningTextReasoningItemContent" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType" + } + }, + "title": "TextReasoningItemContent" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType" + } + }, + "title": "SummaryTextReasoningItemReasoningSummary" + } + ] + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItem" + } + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "title": "MessageResponseItemType" + } + }, + "title": "MessageResponseItem" + }, + { + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType" + } + }, + "title": "ReasoningResponseItem" + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType" + } + }, + "title": "LocalShellCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType" + } + }, + "title": "FunctionCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "execution", + "type" + ], + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType" + } + }, + "title": "ToolSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType" + } + }, + "title": "FunctionCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType" + } + }, + "title": "CustomToolCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType" + } + }, + "title": "CustomToolCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "execution", + "status", + "tools", + "type" + ], + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "type": "array", + "items": true + }, + "type": { + "type": "string", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType" + } + }, + "title": "ToolSearchOutputResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType" + } + }, + "title": "WebSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType" + } + }, + "title": "ImageGenerationCallResponseItem" + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType" + } + }, + "title": "CompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType" + } + }, + "title": "CompactionTriggerResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType" + } + }, + "title": "ContextCompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponseItemType" + } + }, + "title": "OtherResponseItem" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType" + } + }, + "title": "SearchResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType" + } + }, + "title": "OtherResponsesApiWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ReasoningSummaryPartAddedNotification.json b/schemas/v2/ReasoningSummaryPartAddedNotification.json new file mode 100644 index 0000000..b9e449e --- /dev/null +++ b/schemas/v2/ReasoningSummaryPartAddedNotification.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryPartAddedNotification", + "type": "object", + "required": [ + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ReasoningSummaryTextDeltaNotification.json b/schemas/v2/ReasoningSummaryTextDeltaNotification.json new file mode 100644 index 0000000..419c3a4 --- /dev/null +++ b/schemas/v2/ReasoningSummaryTextDeltaNotification.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningSummaryTextDeltaNotification", + "type": "object", + "required": [ + "delta", + "itemId", + "summaryIndex", + "threadId", + "turnId" + ], + "properties": { + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "summaryIndex": { + "type": "integer", + "format": "int64" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ReasoningTextDeltaNotification.json b/schemas/v2/ReasoningTextDeltaNotification.json new file mode 100644 index 0000000..d68ad40 --- /dev/null +++ b/schemas/v2/ReasoningTextDeltaNotification.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReasoningTextDeltaNotification", + "type": "object", + "required": [ + "contentIndex", + "delta", + "itemId", + "threadId", + "turnId" + ], + "properties": { + "contentIndex": { + "type": "integer", + "format": "int64" + }, + "delta": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/RemoteControlStatusChangedNotification.json b/schemas/v2/RemoteControlStatusChangedNotification.json new file mode 100644 index 0000000..1713e1a --- /dev/null +++ b/schemas/v2/RemoteControlStatusChangedNotification.json @@ -0,0 +1,39 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RemoteControlStatusChangedNotification", + "description": "Current remote-control connection status and remote identity exposed to clients.", + "type": "object", + "required": [ + "installationId", + "serverName", + "status" + ], + "properties": { + "environmentId": { + "type": [ + "string", + "null" + ] + }, + "installationId": { + "type": "string" + }, + "serverName": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/RemoteControlConnectionStatus" + } + }, + "definitions": { + "RemoteControlConnectionStatus": { + "type": "string", + "enum": [ + "disabled", + "connecting", + "connected", + "errored" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ReviewStartParams.json b/schemas/v2/ReviewStartParams.json new file mode 100644 index 0000000..9b79979 --- /dev/null +++ b/schemas/v2/ReviewStartParams.json @@ -0,0 +1,129 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartParams", + "type": "object", + "required": [ + "target", + "threadId" + ], + "properties": { + "delivery": { + "description": "Where to run the review: inline (default) on the current thread or detached on a new thread (returned in `reviewThreadId`).", + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ReviewDelivery" + }, + { + "type": "null" + } + ] + }, + "target": { + "$ref": "#/definitions/ReviewTarget" + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ReviewDelivery": { + "type": "string", + "enum": [ + "inline", + "detached" + ] + }, + "ReviewTarget": { + "oneOf": [ + { + "description": "Review the working tree: staged, unstaged, and untracked files.", + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "uncommittedChanges" + ], + "title": "UncommittedChangesReviewTargetType" + } + }, + "title": "UncommittedChangesReviewTarget" + }, + { + "description": "Review changes between the current branch and the given base branch.", + "type": "object", + "required": [ + "branch", + "type" + ], + "properties": { + "branch": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "baseBranch" + ], + "title": "BaseBranchReviewTargetType" + } + }, + "title": "BaseBranchReviewTarget" + }, + { + "description": "Review the changes introduced by a specific commit.", + "type": "object", + "required": [ + "sha", + "type" + ], + "properties": { + "sha": { + "type": "string" + }, + "title": { + "description": "Optional human-readable label (e.g., commit subject) for UIs.", + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "commit" + ], + "title": "CommitReviewTargetType" + } + }, + "title": "CommitReviewTarget" + }, + { + "description": "Arbitrary instructions, equivalent to the old free-form prompt.", + "type": "object", + "required": [ + "instructions", + "type" + ], + "properties": { + "instructions": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ], + "title": "CustomReviewTargetType" + } + }, + "title": "CustomReviewTarget" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ReviewStartResponse.json b/schemas/v2/ReviewStartResponse.json new file mode 100644 index 0000000..c1dcc2d --- /dev/null +++ b/schemas/v2/ReviewStartResponse.json @@ -0,0 +1,1689 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ReviewStartResponse", + "type": "object", + "required": [ + "reviewThreadId", + "turn" + ], + "properties": { + "reviewThreadId": { + "description": "Identifies the thread where the review runs.\n\nFor inline reviews, this is the original thread id. For detached reviews, this is the id of the new review thread.", + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/SendAddCreditsNudgeEmailParams.json b/schemas/v2/SendAddCreditsNudgeEmailParams.json new file mode 100644 index 0000000..43f566f --- /dev/null +++ b/schemas/v2/SendAddCreditsNudgeEmailParams.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailParams", + "type": "object", + "required": [ + "creditType" + ], + "properties": { + "creditType": { + "$ref": "#/definitions/AddCreditsNudgeCreditType" + } + }, + "definitions": { + "AddCreditsNudgeCreditType": { + "type": "string", + "enum": [ + "credits", + "usage_limit" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/SendAddCreditsNudgeEmailResponse.json b/schemas/v2/SendAddCreditsNudgeEmailResponse.json new file mode 100644 index 0000000..57487b0 --- /dev/null +++ b/schemas/v2/SendAddCreditsNudgeEmailResponse.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SendAddCreditsNudgeEmailResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/AddCreditsNudgeEmailStatus" + } + }, + "definitions": { + "AddCreditsNudgeEmailStatus": { + "type": "string", + "enum": [ + "sent", + "cooldown_active" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ServerRequestResolvedNotification.json b/schemas/v2/ServerRequestResolvedNotification.json new file mode 100644 index 0000000..f0f21d7 --- /dev/null +++ b/schemas/v2/ServerRequestResolvedNotification.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ServerRequestResolvedNotification", + "type": "object", + "required": [ + "requestId", + "threadId" + ], + "properties": { + "requestId": { + "$ref": "#/definitions/RequestId" + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "RequestId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer", + "format": "int64" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/SkillsChangedNotification.json b/schemas/v2/SkillsChangedNotification.json new file mode 100644 index 0000000..064e6ef --- /dev/null +++ b/schemas/v2/SkillsChangedNotification.json @@ -0,0 +1,6 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsChangedNotification", + "description": "Notification emitted when watched local skill files change.\n\nTreat this as an invalidation signal and re-run `skills/list` with the client's current parameters when refreshed skill metadata is needed.", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/SkillsConfigWriteParams.json b/schemas/v2/SkillsConfigWriteParams.json new file mode 100644 index 0000000..6a83bdf --- /dev/null +++ b/schemas/v2/SkillsConfigWriteParams.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteParams", + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean" + }, + "name": { + "description": "Name-based selector.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "Path-based selector.", + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/SkillsConfigWriteResponse.json b/schemas/v2/SkillsConfigWriteResponse.json new file mode 100644 index 0000000..111dcb4 --- /dev/null +++ b/schemas/v2/SkillsConfigWriteResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsConfigWriteResponse", + "type": "object", + "required": [ + "effectiveEnabled" + ], + "properties": { + "effectiveEnabled": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/SkillsListParams.json b/schemas/v2/SkillsListParams.json new file mode 100644 index 0000000..9bca76b --- /dev/null +++ b/schemas/v2/SkillsListParams.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListParams", + "type": "object", + "properties": { + "cwds": { + "description": "When empty, defaults to the current session working directory.", + "type": "array", + "items": { + "type": "string" + } + }, + "forceReload": { + "description": "When true, bypass the skills cache and re-scan skills from disk.", + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/SkillsListResponse.json b/schemas/v2/SkillsListResponse.json new file mode 100644 index 0000000..57f81a7 --- /dev/null +++ b/schemas/v2/SkillsListResponse.json @@ -0,0 +1,227 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "SkillsListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillsListEntry" + } + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "SkillDependencies": { + "type": "object", + "required": [ + "tools" + ], + "properties": { + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillToolDependency" + } + } + } + }, + "SkillErrorInfo": { + "type": "object", + "required": [ + "message", + "path" + ], + "properties": { + "message": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "SkillInterface": { + "type": "object", + "properties": { + "brandColor": { + "type": [ + "string", + "null" + ] + }, + "defaultPrompt": { + "type": [ + "string", + "null" + ] + }, + "displayName": { + "type": [ + "string", + "null" + ] + }, + "iconLarge": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "iconSmall": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "shortDescription": { + "type": [ + "string", + "null" + ] + } + } + }, + "SkillMetadata": { + "type": "object", + "required": [ + "description", + "enabled", + "name", + "path", + "scope" + ], + "properties": { + "dependencies": { + "anyOf": [ + { + "$ref": "#/definitions/SkillDependencies" + }, + { + "type": "null" + } + ] + }, + "description": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/SkillInterface" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "scope": { + "$ref": "#/definitions/SkillScope" + }, + "shortDescription": { + "description": "Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.", + "type": [ + "string", + "null" + ] + } + } + }, + "SkillScope": { + "type": "string", + "enum": [ + "user", + "repo", + "system", + "admin" + ] + }, + "SkillToolDependency": { + "type": "object", + "required": [ + "type", + "value" + ], + "properties": { + "command": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + }, + "transport": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ] + }, + "value": { + "type": "string" + } + } + }, + "SkillsListEntry": { + "type": "object", + "required": [ + "cwd", + "errors", + "skills" + ], + "properties": { + "cwd": { + "type": "string" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillErrorInfo" + } + }, + "skills": { + "type": "array", + "items": { + "$ref": "#/definitions/SkillMetadata" + } + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/TerminalInteractionNotification.json b/schemas/v2/TerminalInteractionNotification.json new file mode 100644 index 0000000..823daee --- /dev/null +++ b/schemas/v2/TerminalInteractionNotification.json @@ -0,0 +1,29 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TerminalInteractionNotification", + "type": "object", + "required": [ + "itemId", + "processId", + "stdin", + "threadId", + "turnId" + ], + "properties": { + "itemId": { + "type": "string" + }, + "processId": { + "type": "string" + }, + "stdin": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadApproveGuardianDeniedActionParams.json b/schemas/v2/ThreadApproveGuardianDeniedActionParams.json new file mode 100644 index 0000000..c9d4bfe --- /dev/null +++ b/schemas/v2/ThreadApproveGuardianDeniedActionParams.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionParams", + "type": "object", + "required": [ + "event", + "threadId" + ], + "properties": { + "event": { + "description": "Serialized `codex_protocol::protocol::GuardianAssessmentEvent`." + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadApproveGuardianDeniedActionResponse.json b/schemas/v2/ThreadApproveGuardianDeniedActionResponse.json new file mode 100644 index 0000000..b173819 --- /dev/null +++ b/schemas/v2/ThreadApproveGuardianDeniedActionResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadApproveGuardianDeniedActionResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadArchiveParams.json b/schemas/v2/ThreadArchiveParams.json new file mode 100644 index 0000000..3784f87 --- /dev/null +++ b/schemas/v2/ThreadArchiveParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadArchiveResponse.json b/schemas/v2/ThreadArchiveResponse.json new file mode 100644 index 0000000..bfd853e --- /dev/null +++ b/schemas/v2/ThreadArchiveResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchiveResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadArchivedNotification.json b/schemas/v2/ThreadArchivedNotification.json new file mode 100644 index 0000000..83126d3 --- /dev/null +++ b/schemas/v2/ThreadArchivedNotification.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadArchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadClosedNotification.json b/schemas/v2/ThreadClosedNotification.json new file mode 100644 index 0000000..0d2cf8a --- /dev/null +++ b/schemas/v2/ThreadClosedNotification.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadClosedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadCompactStartParams.json b/schemas/v2/ThreadCompactStartParams.json new file mode 100644 index 0000000..0662c96 --- /dev/null +++ b/schemas/v2/ThreadCompactStartParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadCompactStartResponse.json b/schemas/v2/ThreadCompactStartResponse.json new file mode 100644 index 0000000..bb372b6 --- /dev/null +++ b/schemas/v2/ThreadCompactStartResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadCompactStartResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadForkParams.json b/schemas/v2/ThreadForkParams.json new file mode 100644 index 0000000..533918d --- /dev/null +++ b/schemas/v2/ThreadForkParams.json @@ -0,0 +1,180 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkParams", + "description": "There are two ways to fork a thread: 1. By thread_id: load the thread from disk by thread_id and fork it into a new thread. 2. By path: load the thread from disk by path and fork it into a new thread.\n\nIf using path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "ephemeral": { + "type": "boolean" + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this forked thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "model": { + "description": "Configuration overrides for the forked thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadForkResponse.json b/schemas/v2/ThreadForkResponse.json new file mode 100644 index 0000000..8ab1348 --- /dev/null +++ b/schemas/v2/ThreadForkResponse.json @@ -0,0 +1,2302 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadForkResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "thread": { + "$ref": "#/definitions/Thread" + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "AgentPath": { + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadGoalClearedNotification.json b/schemas/v2/ThreadGoalClearedNotification.json new file mode 100644 index 0000000..7441ced --- /dev/null +++ b/schemas/v2/ThreadGoalClearedNotification.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalClearedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadGoalUpdatedNotification.json b/schemas/v2/ThreadGoalUpdatedNotification.json new file mode 100644 index 0000000..44cf369 --- /dev/null +++ b/schemas/v2/ThreadGoalUpdatedNotification.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadGoalUpdatedNotification", + "type": "object", + "required": [ + "goal", + "threadId" + ], + "properties": { + "goal": { + "$ref": "#/definitions/ThreadGoal" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "ThreadGoal": { + "type": "object", + "required": [ + "createdAt", + "objective", + "status", + "threadId", + "timeUsedSeconds", + "tokensUsed", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "integer", + "format": "int64" + }, + "objective": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/ThreadGoalStatus" + }, + "threadId": { + "type": "string" + }, + "timeUsedSeconds": { + "type": "integer", + "format": "int64" + }, + "tokenBudget": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "tokensUsed": { + "type": "integer", + "format": "int64" + }, + "updatedAt": { + "type": "integer", + "format": "int64" + } + } + }, + "ThreadGoalStatus": { + "type": "string", + "enum": [ + "active", + "paused", + "blocked", + "usageLimited", + "budgetLimited", + "complete" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadInjectItemsParams.json b/schemas/v2/ThreadInjectItemsParams.json new file mode 100644 index 0000000..53afb30 --- /dev/null +++ b/schemas/v2/ThreadInjectItemsParams.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsParams", + "type": "object", + "required": [ + "items", + "threadId" + ], + "properties": { + "items": { + "description": "Raw Responses API items to append to the thread's model-visible history.", + "type": "array", + "items": true + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadInjectItemsResponse.json b/schemas/v2/ThreadInjectItemsResponse.json new file mode 100644 index 0000000..2ba62b2 --- /dev/null +++ b/schemas/v2/ThreadInjectItemsResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadInjectItemsResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadListParams.json b/schemas/v2/ThreadListParams.json new file mode 100644 index 0000000..46a8683 --- /dev/null +++ b/schemas/v2/ThreadListParams.json @@ -0,0 +1,138 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListParams", + "type": "object", + "properties": { + "archived": { + "description": "Optional archived filter; when set to true, only archived threads are returned. If false or null, only non-archived threads are returned.", + "type": [ + "boolean", + "null" + ] + }, + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Optional cwd filter or filters; when set, only threads whose session cwd exactly matches one of these paths are returned.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadListCwdFilter" + }, + { + "type": "null" + } + ] + }, + "limit": { + "description": "Optional page size; defaults to a reasonable server-side value.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "modelProviders": { + "description": "Optional provider filter; when set, only sessions recorded under these providers are returned. When present but empty, includes all providers.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "searchTerm": { + "description": "Optional substring filter for the extracted thread title.", + "type": [ + "string", + "null" + ] + }, + "sortDirection": { + "description": "Optional sort direction; defaults to descending (newest first).", + "anyOf": [ + { + "$ref": "#/definitions/SortDirection" + }, + { + "type": "null" + } + ] + }, + "sortKey": { + "description": "Optional sort key; defaults to created_at.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSortKey" + }, + { + "type": "null" + } + ] + }, + "sourceKinds": { + "description": "Optional source filter; when set, only sessions from these source kinds are returned. When omitted or empty, defaults to interactive sources.", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ThreadSourceKind" + } + }, + "useStateDbOnly": { + "description": "If true, return from the state DB without scanning JSONL rollouts to repair thread metadata. Omitted or false preserves scan-and-repair behavior.", + "type": "boolean" + } + }, + "definitions": { + "SortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "ThreadListCwdFilter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ThreadSortKey": { + "type": "string", + "enum": [ + "created_at", + "updated_at" + ] + }, + "ThreadSourceKind": { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "subAgent", + "subAgentReview", + "subAgentCompact", + "subAgentThreadSpawn", + "subAgentOther", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadListResponse.json b/schemas/v2/ThreadListResponse.json new file mode 100644 index 0000000..36df4f9 --- /dev/null +++ b/schemas/v2/ThreadListResponse.json @@ -0,0 +1,2076 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "backwardsCursor": { + "description": "Opaque cursor to pass as `cursor` when reversing `sortDirection`. This is only populated when the page contains at least one thread. Use it with the opposite `sortDirection`; for timestamp sorts it anchors at the start of the page timestamp so same-second updates are not skipped.", + "type": [ + "string", + "null" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Thread" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadLoadedListParams.json b/schemas/v2/ThreadLoadedListParams.json new file mode 100644 index 0000000..7c4e08c --- /dev/null +++ b/schemas/v2/ThreadLoadedListParams.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListParams", + "type": "object", + "properties": { + "cursor": { + "description": "Opaque pagination cursor returned by a previous call.", + "type": [ + "string", + "null" + ] + }, + "limit": { + "description": "Optional page size; defaults to no limit.", + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadLoadedListResponse.json b/schemas/v2/ThreadLoadedListResponse.json new file mode 100644 index 0000000..7a1bbcd --- /dev/null +++ b/schemas/v2/ThreadLoadedListResponse.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadLoadedListResponse", + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "description": "Thread ids for sessions currently loaded in memory.", + "type": "array", + "items": { + "type": "string" + } + }, + "nextCursor": { + "description": "Opaque cursor to pass to the next call to continue after the last item. if None, there are no more items to return.", + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadMetadataUpdateParams.json b/schemas/v2/ThreadMetadataUpdateParams.json new file mode 100644 index 0000000..313a762 --- /dev/null +++ b/schemas/v2/ThreadMetadataUpdateParams.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "gitInfo": { + "description": "Patch the stored Git metadata for this thread. Omit a field to leave it unchanged, set it to `null` to clear it, or provide a string to replace the stored value.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadMetadataGitInfoUpdateParams" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ThreadMetadataGitInfoUpdateParams": { + "type": "object", + "properties": { + "branch": { + "description": "Omit to leave the stored branch unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "description": "Omit to leave the stored origin URL unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "Omit to leave the stored commit unchanged, set to `null` to clear it, or provide a non-empty string to replace it.", + "type": [ + "string", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadMetadataUpdateResponse.json b/schemas/v2/ThreadMetadataUpdateResponse.json new file mode 100644 index 0000000..e9a63d3 --- /dev/null +++ b/schemas/v2/ThreadMetadataUpdateResponse.json @@ -0,0 +1,2059 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadMetadataUpdateResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadNameUpdatedNotification.json b/schemas/v2/ThreadNameUpdatedNotification.json new file mode 100644 index 0000000..705cd8b --- /dev/null +++ b/schemas/v2/ThreadNameUpdatedNotification.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadNameUpdatedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "threadName": { + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadReadParams.json b/schemas/v2/ThreadReadParams.json new file mode 100644 index 0000000..76ce44a --- /dev/null +++ b/schemas/v2/ThreadReadParams.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "includeTurns": { + "description": "When true, include turns and their items from rollout history.", + "default": false, + "type": "boolean" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadReadResponse.json b/schemas/v2/ThreadReadResponse.json new file mode 100644 index 0000000..03f087c --- /dev/null +++ b/schemas/v2/ThreadReadResponse.json @@ -0,0 +1,2059 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadReadResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeClosedNotification.json b/schemas/v2/ThreadRealtimeClosedNotification.json new file mode 100644 index 0000000..58276d1 --- /dev/null +++ b/schemas/v2/ThreadRealtimeClosedNotification.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeClosedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime transport closes.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "reason": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeErrorNotification.json b/schemas/v2/ThreadRealtimeErrorNotification.json new file mode 100644 index 0000000..0ddd7d4 --- /dev/null +++ b/schemas/v2/ThreadRealtimeErrorNotification.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeErrorNotification", + "description": "EXPERIMENTAL - emitted when thread realtime encounters an error.", + "type": "object", + "required": [ + "message", + "threadId" + ], + "properties": { + "message": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeItemAddedNotification.json b/schemas/v2/ThreadRealtimeItemAddedNotification.json new file mode 100644 index 0000000..00fe35c --- /dev/null +++ b/schemas/v2/ThreadRealtimeItemAddedNotification.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeItemAddedNotification", + "description": "EXPERIMENTAL - raw non-audio thread realtime item emitted by the backend.", + "type": "object", + "required": [ + "item", + "threadId" + ], + "properties": { + "item": true, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeOutputAudioDeltaNotification.json b/schemas/v2/ThreadRealtimeOutputAudioDeltaNotification.json new file mode 100644 index 0000000..5e681f5 --- /dev/null +++ b/schemas/v2/ThreadRealtimeOutputAudioDeltaNotification.json @@ -0,0 +1,58 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeOutputAudioDeltaNotification", + "description": "EXPERIMENTAL - streamed output audio emitted by thread realtime.", + "type": "object", + "required": [ + "audio", + "threadId" + ], + "properties": { + "audio": { + "$ref": "#/definitions/ThreadRealtimeAudioChunk" + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ThreadRealtimeAudioChunk": { + "description": "EXPERIMENTAL - thread realtime audio chunk.", + "type": "object", + "required": [ + "data", + "numChannels", + "sampleRate" + ], + "properties": { + "data": { + "type": "string" + }, + "itemId": { + "type": [ + "string", + "null" + ] + }, + "numChannels": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "sampleRate": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "samplesPerChannel": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeSdpNotification.json b/schemas/v2/ThreadRealtimeSdpNotification.json new file mode 100644 index 0000000..94089a9 --- /dev/null +++ b/schemas/v2/ThreadRealtimeSdpNotification.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeSdpNotification", + "description": "EXPERIMENTAL - emitted with the remote SDP for a WebRTC realtime session.", + "type": "object", + "required": [ + "sdp", + "threadId" + ], + "properties": { + "sdp": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeStartedNotification.json b/schemas/v2/ThreadRealtimeStartedNotification.json new file mode 100644 index 0000000..07c0fd5 --- /dev/null +++ b/schemas/v2/ThreadRealtimeStartedNotification.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeStartedNotification", + "description": "EXPERIMENTAL - emitted when thread realtime startup is accepted.", + "type": "object", + "required": [ + "threadId", + "version" + ], + "properties": { + "realtimeSessionId": { + "type": [ + "string", + "null" + ] + }, + "threadId": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/RealtimeConversationVersion" + } + }, + "definitions": { + "RealtimeConversationVersion": { + "type": "string", + "enum": [ + "v1", + "v2" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeTranscriptDeltaNotification.json b/schemas/v2/ThreadRealtimeTranscriptDeltaNotification.json new file mode 100644 index 0000000..0662920 --- /dev/null +++ b/schemas/v2/ThreadRealtimeTranscriptDeltaNotification.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDeltaNotification", + "description": "EXPERIMENTAL - flat transcript delta emitted whenever realtime transcript text changes.", + "type": "object", + "required": [ + "delta", + "role", + "threadId" + ], + "properties": { + "delta": { + "description": "Live transcript delta from the realtime event.", + "type": "string" + }, + "role": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRealtimeTranscriptDoneNotification.json b/schemas/v2/ThreadRealtimeTranscriptDoneNotification.json new file mode 100644 index 0000000..f19a70a --- /dev/null +++ b/schemas/v2/ThreadRealtimeTranscriptDoneNotification.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRealtimeTranscriptDoneNotification", + "description": "EXPERIMENTAL - final transcript text emitted when realtime completes a transcript part.", + "type": "object", + "required": [ + "role", + "text", + "threadId" + ], + "properties": { + "role": { + "type": "string" + }, + "text": { + "description": "Final complete text for the transcript part.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadResumeParams.json b/schemas/v2/ThreadResumeParams.json new file mode 100644 index 0000000..4d1aade --- /dev/null +++ b/schemas/v2/ThreadResumeParams.json @@ -0,0 +1,1062 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeParams", + "description": "There are three ways to resume a thread: 1. By thread_id: load the thread from disk by thread_id and resume it. 2. By history: instantiate the thread from memory and resume it. 3. By path: load the thread from disk by path and resume it.\n\nThe precedence is: history > path > thread_id. If using history or path, the thread_id param will be ignored.\n\nPrefer using thread_id whenever possible.", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "model": { + "description": "Configuration overrides for the resumed thread, if any.", + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextContentItemType" + } + }, + "title": "InputTextContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageContentItemType" + } + }, + "title": "InputImageContentItem" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "title": "OutputTextContentItemType" + } + }, + "title": "OutputTextContentItem" + } + ] + }, + "FunctionCallOutputBody": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/definitions/FunctionCallOutputContentItem" + } + } + ] + }, + "FunctionCallOutputContentItem": { + "description": "Responses API compatible content items that can be returned by a tool call. This is a subset of ContentItem with the types we support as function call outputs.", + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "title": "InputTextFunctionCallOutputContentItemType" + } + }, + "title": "InputTextFunctionCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "image_url", + "type" + ], + "properties": { + "detail": { + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "image_url": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "title": "InputImageFunctionCallOutputContentItemType" + } + }, + "title": "InputImageFunctionCallOutputContentItem" + } + ] + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "LocalShellAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "array", + "items": { + "type": "string" + } + }, + "env": { + "type": [ + "object", + "null" + ], + "additionalProperties": { + "type": "string" + } + }, + "timeout_ms": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "type": { + "type": "string", + "enum": [ + "exec" + ], + "title": "ExecLocalShellActionType" + }, + "user": { + "type": [ + "string", + "null" + ] + }, + "working_directory": { + "type": [ + "string", + "null" + ] + } + }, + "title": "ExecLocalShellAction" + } + ] + }, + "LocalShellStatus": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "incomplete" + ] + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "ReasoningItemContent": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextReasoningItemContentType" + } + }, + "title": "ReasoningTextReasoningItemContent" + }, + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextReasoningItemContentType" + } + }, + "title": "TextReasoningItemContent" + } + ] + }, + "ReasoningItemReasoningSummary": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "SummaryTextReasoningItemReasoningSummaryType" + } + }, + "title": "SummaryTextReasoningItemReasoningSummary" + } + ] + }, + "ResponseItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "role", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/ContentItem" + } + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "phase": { + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "title": "MessageResponseItemType" + } + }, + "title": "MessageResponseItem" + }, + { + "type": "object", + "required": [ + "summary", + "type" + ], + "properties": { + "content": { + "default": null, + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/ReasoningItemContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/definitions/ReasoningItemReasoningSummary" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningResponseItemType" + } + }, + "title": "ReasoningResponseItem" + }, + { + "type": "object", + "required": [ + "action", + "status", + "type" + ], + "properties": { + "action": { + "$ref": "#/definitions/LocalShellAction" + }, + "call_id": { + "description": "Set when using the Responses API.", + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Legacy id field retained for compatibility with older payloads.", + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/LocalShellStatus" + }, + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "title": "LocalShellCallResponseItemType" + } + }, + "title": "LocalShellCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "call_id", + "name", + "type" + ], + "properties": { + "arguments": { + "type": "string" + }, + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "title": "FunctionCallResponseItemType" + } + }, + "title": "FunctionCallResponseItem" + }, + { + "type": "object", + "required": [ + "arguments", + "execution", + "type" + ], + "properties": { + "arguments": true, + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "tool_search_call" + ], + "title": "ToolSearchCallResponseItemType" + } + }, + "title": "ToolSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "title": "FunctionCallOutputResponseItemType" + } + }, + "title": "FunctionCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "input", + "name", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "input": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "title": "CustomToolCallResponseItemType" + } + }, + "title": "CustomToolCallResponseItem" + }, + { + "type": "object", + "required": [ + "call_id", + "output", + "type" + ], + "properties": { + "call_id": { + "type": "string" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "output": { + "$ref": "#/definitions/FunctionCallOutputBody" + }, + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "title": "CustomToolCallOutputResponseItemType" + } + }, + "title": "CustomToolCallOutputResponseItem" + }, + { + "type": "object", + "required": [ + "execution", + "status", + "tools", + "type" + ], + "properties": { + "call_id": { + "type": [ + "string", + "null" + ] + }, + "execution": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tools": { + "type": "array", + "items": true + }, + "type": { + "type": "string", + "enum": [ + "tool_search_output" + ], + "title": "ToolSearchOutputResponseItemType" + } + }, + "title": "ToolSearchOutputResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/ResponsesApiWebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "writeOnly": true, + "type": [ + "string", + "null" + ] + }, + "status": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "title": "WebSearchCallResponseItemType" + } + }, + "title": "WebSearchCallResponseItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revised_prompt": { + "type": [ + "string", + "null" + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "title": "ImageGenerationCallResponseItemType" + } + }, + "title": "ImageGenerationCallResponseItem" + }, + { + "type": "object", + "required": [ + "encrypted_content", + "type" + ], + "properties": { + "encrypted_content": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "title": "CompactionResponseItemType" + } + }, + "title": "CompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction_trigger" + ], + "title": "CompactionTriggerResponseItemType" + } + }, + "title": "CompactionTriggerResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "context_compaction" + ], + "title": "ContextCompactionResponseItemType" + } + }, + "title": "ContextCompactionResponseItem" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponseItemType" + } + }, + "title": "OtherResponseItem" + } + ] + }, + "ResponsesApiWebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchResponsesApiWebSearchActionType" + } + }, + "title": "SearchResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "title": "OpenPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "title": "FindInPageResponsesApiWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageResponsesApiWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherResponsesApiWebSearchActionType" + } + }, + "title": "OtherResponsesApiWebSearchAction" + } + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadResumeResponse.json b/schemas/v2/ThreadResumeResponse.json new file mode 100644 index 0000000..811e092 --- /dev/null +++ b/schemas/v2/ThreadResumeResponse.json @@ -0,0 +1,2302 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadResumeResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "AgentPath": { + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRollbackParams.json b/schemas/v2/ThreadRollbackParams.json new file mode 100644 index 0000000..bc91ce4 --- /dev/null +++ b/schemas/v2/ThreadRollbackParams.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackParams", + "type": "object", + "required": [ + "numTurns", + "threadId" + ], + "properties": { + "numTurns": { + "description": "The number of turns to drop from the end of the thread. Must be >= 1.\n\nThis only modifies the thread's history and does not revert local file changes that have been made by the agent. Clients are responsible for reverting these changes.", + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadRollbackResponse.json b/schemas/v2/ThreadRollbackResponse.json new file mode 100644 index 0000000..474c8f2 --- /dev/null +++ b/schemas/v2/ThreadRollbackResponse.json @@ -0,0 +1,2064 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadRollbackResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "description": "The updated thread after applying the rollback, with `turns` populated.\n\nThe ThreadItems stored in each Turn are lossy since we explicitly do not persist all agent interactions, such as command executions. This is the same behavior as `thread/resume`.", + "allOf": [ + { + "$ref": "#/definitions/Thread" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadSetNameParams.json b/schemas/v2/ThreadSetNameParams.json new file mode 100644 index 0000000..3c70135 --- /dev/null +++ b/schemas/v2/ThreadSetNameParams.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameParams", + "type": "object", + "required": [ + "name", + "threadId" + ], + "properties": { + "name": { + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadSetNameResponse.json b/schemas/v2/ThreadSetNameResponse.json new file mode 100644 index 0000000..3d25712 --- /dev/null +++ b/schemas/v2/ThreadSetNameResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadSetNameResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadShellCommandParams.json b/schemas/v2/ThreadShellCommandParams.json new file mode 100644 index 0000000..8965b04 --- /dev/null +++ b/schemas/v2/ThreadShellCommandParams.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandParams", + "type": "object", + "required": [ + "command", + "threadId" + ], + "properties": { + "command": { + "description": "Shell command string evaluated by the thread's configured shell. Unlike `command/exec`, this intentionally preserves shell syntax such as pipes, redirects, and quoting. This runs unsandboxed with full access rather than inheriting the thread sandbox policy.", + "type": "string" + }, + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadShellCommandResponse.json b/schemas/v2/ThreadShellCommandResponse.json new file mode 100644 index 0000000..06e9d81 --- /dev/null +++ b/schemas/v2/ThreadShellCommandResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadShellCommandResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/ThreadStartParams.json b/schemas/v2/ThreadStartParams.json new file mode 100644 index 0000000..53e3741 --- /dev/null +++ b/schemas/v2/ThreadStartParams.json @@ -0,0 +1,261 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartParams", + "type": "object", + "properties": { + "approvalPolicy": { + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this thread and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "baseInstructions": { + "type": [ + "string", + "null" + ] + }, + "config": { + "type": [ + "object", + "null" + ], + "additionalProperties": true + }, + "cwd": { + "type": [ + "string", + "null" + ] + }, + "developerInstructions": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "anyOf": [ + { + "$ref": "#/definitions/SandboxMode" + }, + { + "type": "null" + } + ] + }, + "sessionStartSource": { + "anyOf": [ + { + "$ref": "#/definitions/ThreadStartSource" + }, + { + "type": "null" + } + ] + }, + "ephemeral": { + "type": [ + "boolean", + "null" + ] + }, + "threadSource": { + "description": "Optional client-supplied analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "personality": { + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": [ + "string", + "null" + ] + }, + "modelProvider": { + "type": [ + "string", + "null" + ] + }, + "serviceName": { + "type": [ + "string", + "null" + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "DynamicToolSpec": { + "type": "object", + "required": [ + "description", + "inputSchema", + "name" + ], + "properties": { + "deferLoading": { + "type": "boolean" + }, + "description": { + "type": "string" + }, + "inputSchema": true, + "name": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + } + } + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "SandboxMode": { + "type": "string", + "enum": [ + "read-only", + "workspace-write", + "danger-full-access" + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStartSource": { + "type": "string", + "enum": [ + "startup", + "clear" + ] + }, + "TurnEnvironmentParams": { + "type": "object", + "required": [ + "cwd", + "environmentId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "environmentId": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadStartResponse.json b/schemas/v2/ThreadStartResponse.json new file mode 100644 index 0000000..ca63870 --- /dev/null +++ b/schemas/v2/ThreadStartResponse.json @@ -0,0 +1,2302 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartResponse", + "type": "object", + "required": [ + "approvalPolicy", + "approvalsReviewer", + "cwd", + "model", + "modelProvider", + "sandbox", + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + }, + "approvalPolicy": { + "$ref": "#/definitions/AskForApproval" + }, + "approvalsReviewer": { + "description": "Reviewer currently used for approval requests on this thread.", + "allOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + } + ] + }, + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "instructionSources": { + "description": "Instruction source files currently loaded for this thread.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + }, + "model": { + "type": "string" + }, + "modelProvider": { + "type": "string" + }, + "reasoningEffort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "type": [ + "string", + "null" + ] + }, + "sandbox": { + "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance.", + "allOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ActivePermissionProfile": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "extends": { + "description": "Parent profile identifier once permissions profiles support inheritance. This is currently always `null`.", + "default": null, + "type": [ + "string", + "null" + ] + }, + "id": { + "description": "Identifier from `default_permissions` or the implicit built-in default, such as `:workspace` or a user-defined `[permissions.]` profile.", + "type": "string" + } + } + }, + "AgentPath": { + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadStartedNotification.json b/schemas/v2/ThreadStartedNotification.json new file mode 100644 index 0000000..59785fb --- /dev/null +++ b/schemas/v2/ThreadStartedNotification.json @@ -0,0 +1,2059 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStartedNotification", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadStatusChangedNotification.json b/schemas/v2/ThreadStatusChangedNotification.json new file mode 100644 index 0000000..74176bb --- /dev/null +++ b/schemas/v2/ThreadStatusChangedNotification.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadStatusChangedNotification", + "type": "object", + "required": [ + "status", + "threadId" + ], + "properties": { + "status": { + "$ref": "#/definitions/ThreadStatus" + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadTokenUsageUpdatedNotification.json b/schemas/v2/ThreadTokenUsageUpdatedNotification.json new file mode 100644 index 0000000..179e5f3 --- /dev/null +++ b/schemas/v2/ThreadTokenUsageUpdatedNotification.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadTokenUsageUpdatedNotification", + "type": "object", + "required": [ + "threadId", + "tokenUsage", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "tokenUsage": { + "$ref": "#/definitions/ThreadTokenUsage" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "ThreadTokenUsage": { + "type": "object", + "required": [ + "last", + "total" + ], + "properties": { + "last": { + "$ref": "#/definitions/TokenUsageBreakdown" + }, + "modelContextWindow": { + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "total": { + "$ref": "#/definitions/TokenUsageBreakdown" + } + } + }, + "TokenUsageBreakdown": { + "type": "object", + "required": [ + "cachedInputTokens", + "inputTokens", + "outputTokens", + "reasoningOutputTokens", + "totalTokens" + ], + "properties": { + "cachedInputTokens": { + "type": "integer", + "format": "int64" + }, + "inputTokens": { + "type": "integer", + "format": "int64" + }, + "outputTokens": { + "type": "integer", + "format": "int64" + }, + "reasoningOutputTokens": { + "type": "integer", + "format": "int64" + }, + "totalTokens": { + "type": "integer", + "format": "int64" + } + } + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadUnarchiveParams.json b/schemas/v2/ThreadUnarchiveParams.json new file mode 100644 index 0000000..d61b125 --- /dev/null +++ b/schemas/v2/ThreadUnarchiveParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadUnarchiveResponse.json b/schemas/v2/ThreadUnarchiveResponse.json new file mode 100644 index 0000000..ea5922c --- /dev/null +++ b/schemas/v2/ThreadUnarchiveResponse.json @@ -0,0 +1,2059 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchiveResponse", + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "$ref": "#/definitions/Thread" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "AgentPath": { + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "GitInfo": { + "type": "object", + "properties": { + "branch": { + "type": [ + "string", + "null" + ] + }, + "originUrl": { + "type": [ + "string", + "null" + ] + }, + "sha": { + "type": [ + "string", + "null" + ] + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "SessionSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "cli", + "vscode", + "exec", + "appServer", + "unknown" + ] + }, + { + "type": "object", + "required": [ + "custom" + ], + "properties": { + "custom": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "CustomSessionSource" + }, + { + "type": "object", + "required": [ + "subAgent" + ], + "properties": { + "subAgent": { + "$ref": "#/definitions/SubAgentSource" + } + }, + "additionalProperties": false, + "title": "SubAgentSessionSource" + } + ] + }, + "SubAgentSource": { + "oneOf": [ + { + "type": "string", + "enum": [ + "review", + "compact", + "memory_consolidation" + ] + }, + { + "type": "object", + "required": [ + "thread_spawn" + ], + "properties": { + "thread_spawn": { + "type": "object", + "required": [ + "depth", + "parent_thread_id" + ], + "properties": { + "agent_nickname": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "agent_path": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/AgentPath" + }, + { + "type": "null" + } + ] + }, + "agent_role": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "depth": { + "type": "integer", + "format": "int32" + }, + "parent_thread_id": { + "$ref": "#/definitions/ThreadId" + } + } + } + }, + "additionalProperties": false, + "title": "ThreadSpawnSubAgentSource" + }, + { + "type": "object", + "required": [ + "other" + ], + "properties": { + "other": { + "type": "string" + } + }, + "additionalProperties": false, + "title": "OtherSubAgentSource" + } + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "Thread": { + "type": "object", + "required": [ + "cliVersion", + "createdAt", + "cwd", + "ephemeral", + "id", + "modelProvider", + "preview", + "sessionId", + "source", + "status", + "turns", + "updatedAt" + ], + "properties": { + "agentNickname": { + "description": "Optional random unique nickname assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "agentRole": { + "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.", + "type": [ + "string", + "null" + ] + }, + "cliVersion": { + "description": "Version of the CLI that created the thread.", + "type": "string" + }, + "createdAt": { + "description": "Unix timestamp (in seconds) when the thread was created.", + "type": "integer", + "format": "int64" + }, + "cwd": { + "description": "Working directory captured for the thread.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "ephemeral": { + "description": "Whether the thread is ephemeral and should not be materialized on disk.", + "type": "boolean" + }, + "forkedFromId": { + "description": "Source thread id when this thread was created by forking another thread.", + "type": [ + "string", + "null" + ] + }, + "gitInfo": { + "description": "Optional Git metadata captured when the thread was created.", + "anyOf": [ + { + "$ref": "#/definitions/GitInfo" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "modelProvider": { + "description": "Model provider used for this thread (for example, 'openai').", + "type": "string" + }, + "name": { + "description": "Optional user-facing thread title.", + "type": [ + "string", + "null" + ] + }, + "path": { + "description": "[UNSTABLE] Path to the thread on disk.", + "type": [ + "string", + "null" + ] + }, + "preview": { + "description": "Usually the first user message in the thread, if available.", + "type": "string" + }, + "sessionId": { + "description": "Session id shared by threads that belong to the same session tree.", + "type": "string" + }, + "source": { + "description": "Origin of the thread (CLI, VSCode, codex exec, codex app-server, etc.).", + "allOf": [ + { + "$ref": "#/definitions/SessionSource" + } + ] + }, + "status": { + "description": "Current runtime status for the thread.", + "allOf": [ + { + "$ref": "#/definitions/ThreadStatus" + } + ] + }, + "threadSource": { + "description": "Optional analytics source classification for this thread.", + "anyOf": [ + { + "$ref": "#/definitions/ThreadSource" + }, + { + "type": "null" + } + ] + }, + "turns": { + "description": "Only populated on `thread/resume`, `thread/rollback`, `thread/fork`, and `thread/read` (when `includeTurns` is true) responses. For all other responses and notifications returning a Thread, the turns field will be an empty list.", + "type": "array", + "items": { + "$ref": "#/definitions/Turn" + } + }, + "updatedAt": { + "description": "Unix timestamp (in seconds) when the thread was last updated.", + "type": "integer", + "format": "int64" + } + } + }, + "ThreadActiveFlag": { + "type": "string", + "enum": [ + "waitingOnApproval", + "waitingOnUserInput" + ] + }, + "ThreadId": { + "type": "string" + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "ThreadSource": { + "type": "string", + "enum": [ + "user", + "subagent", + "memory_consolidation" + ] + }, + "ThreadStatus": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "notLoaded" + ], + "title": "NotLoadedThreadStatusType" + } + }, + "title": "NotLoadedThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "idle" + ], + "title": "IdleThreadStatusType" + } + }, + "title": "IdleThreadStatus" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "systemError" + ], + "title": "SystemErrorThreadStatusType" + } + }, + "title": "SystemErrorThreadStatus" + }, + { + "type": "object", + "required": [ + "activeFlags", + "type" + ], + "properties": { + "activeFlags": { + "type": "array", + "items": { + "$ref": "#/definitions/ThreadActiveFlag" + } + }, + "type": { + "type": "string", + "enum": [ + "active" + ], + "title": "ActiveThreadStatusType" + } + }, + "title": "ActiveThreadStatus" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadUnarchivedNotification.json b/schemas/v2/ThreadUnarchivedNotification.json new file mode 100644 index 0000000..b19eb28 --- /dev/null +++ b/schemas/v2/ThreadUnarchivedNotification.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnarchivedNotification", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadUnsubscribeParams.json b/schemas/v2/ThreadUnsubscribeParams.json new file mode 100644 index 0000000..ddb3121 --- /dev/null +++ b/schemas/v2/ThreadUnsubscribeParams.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeParams", + "type": "object", + "required": [ + "threadId" + ], + "properties": { + "threadId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/ThreadUnsubscribeResponse.json b/schemas/v2/ThreadUnsubscribeResponse.json new file mode 100644 index 0000000..ade0e65 --- /dev/null +++ b/schemas/v2/ThreadUnsubscribeResponse.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ThreadUnsubscribeResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/ThreadUnsubscribeStatus" + } + }, + "definitions": { + "ThreadUnsubscribeStatus": { + "type": "string", + "enum": [ + "notLoaded", + "notSubscribed", + "unsubscribed" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnCompletedNotification.json b/schemas/v2/TurnCompletedNotification.json new file mode 100644 index 0000000..7dc7c57 --- /dev/null +++ b/schemas/v2/TurnCompletedNotification.json @@ -0,0 +1,1688 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnCompletedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnDiffUpdatedNotification.json b/schemas/v2/TurnDiffUpdatedNotification.json new file mode 100644 index 0000000..e439476 --- /dev/null +++ b/schemas/v2/TurnDiffUpdatedNotification.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnDiffUpdatedNotification", + "description": "Notification that the turn-level unified diff has changed. Contains the latest aggregated diff across all file changes in the turn.", + "type": "object", + "required": [ + "diff", + "threadId", + "turnId" + ], + "properties": { + "diff": { + "type": "string" + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnInterruptParams.json b/schemas/v2/TurnInterruptParams.json new file mode 100644 index 0000000..f38a75e --- /dev/null +++ b/schemas/v2/TurnInterruptParams.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptParams", + "type": "object", + "required": [ + "threadId", + "turnId" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnInterruptResponse.json b/schemas/v2/TurnInterruptResponse.json new file mode 100644 index 0000000..5d8a0f9 --- /dev/null +++ b/schemas/v2/TurnInterruptResponse.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnInterruptResponse", + "type": "object" +} \ No newline at end of file diff --git a/schemas/v2/TurnPlanUpdatedNotification.json b/schemas/v2/TurnPlanUpdatedNotification.json new file mode 100644 index 0000000..0f83538 --- /dev/null +++ b/schemas/v2/TurnPlanUpdatedNotification.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnPlanUpdatedNotification", + "type": "object", + "required": [ + "plan", + "threadId", + "turnId" + ], + "properties": { + "explanation": { + "type": [ + "string", + "null" + ] + }, + "plan": { + "type": "array", + "items": { + "$ref": "#/definitions/TurnPlanStep" + } + }, + "threadId": { + "type": "string" + }, + "turnId": { + "type": "string" + } + }, + "definitions": { + "TurnPlanStep": { + "type": "object", + "required": [ + "status", + "step" + ], + "properties": { + "status": { + "$ref": "#/definitions/TurnPlanStepStatus" + }, + "step": { + "type": "string" + } + } + }, + "TurnPlanStepStatus": { + "type": "string", + "enum": [ + "pending", + "inProgress", + "completed" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnStartParams.json b/schemas/v2/TurnStartParams.json new file mode 100644 index 0000000..16edece --- /dev/null +++ b/schemas/v2/TurnStartParams.json @@ -0,0 +1,579 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartParams", + "type": "object", + "required": [ + "input", + "threadId" + ], + "properties": { + "approvalPolicy": { + "description": "Override the approval policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/AskForApproval" + }, + { + "type": "null" + } + ] + }, + "approvalsReviewer": { + "description": "Override where approval requests are routed for review on this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ApprovalsReviewer" + }, + { + "type": "null" + } + ] + }, + "serviceTier": { + "description": "Override the service tier for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "cwd": { + "description": "Override the working directory for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "effort": { + "description": "Override the reasoning effort for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "threadId": { + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "model": { + "description": "Override the model for this turn and subsequent turns.", + "type": [ + "string", + "null" + ] + }, + "outputSchema": { + "description": "Optional JSON Schema used to constrain the final assistant message for this turn." + }, + "summary": { + "description": "Override the reasoning summary for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningSummary" + }, + { + "type": "null" + } + ] + }, + "personality": { + "description": "Override the personality for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/Personality" + }, + { + "type": "null" + } + ] + }, + "sandboxPolicy": { + "description": "Override the sandbox policy for this turn and subsequent turns.", + "anyOf": [ + { + "$ref": "#/definitions/SandboxPolicy" + }, + { + "type": "null" + } + ] + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ApprovalsReviewer": { + "description": "Configures who approval requests are routed to for review. Examples include sandbox escapes, blocked network access, MCP approval prompts, and ARC escalations. Defaults to `user`. `auto_review` uses a carefully prompted subagent to gather relevant context and apply a risk-based decision framework before approving or denying the request. The legacy value `guardian_subagent` is accepted for compatibility.", + "type": "string", + "enum": [ + "user", + "auto_review", + "guardian_subagent" + ] + }, + "AskForApproval": { + "oneOf": [ + { + "type": "string", + "enum": [ + "untrusted", + "on-failure", + "on-request", + "never" + ] + }, + { + "type": "object", + "required": [ + "granular" + ], + "properties": { + "granular": { + "type": "object", + "required": [ + "mcp_elicitations", + "rules", + "sandbox_approval" + ], + "properties": { + "mcp_elicitations": { + "type": "boolean" + }, + "request_permissions": { + "default": false, + "type": "boolean" + }, + "rules": { + "type": "boolean" + }, + "sandbox_approval": { + "type": "boolean" + }, + "skill_approval": { + "default": false, + "type": "boolean" + } + } + } + }, + "additionalProperties": false, + "title": "GranularAskForApproval" + } + ] + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CollaborationMode": { + "description": "Collaboration mode for a Codex session.", + "type": "object", + "required": [ + "mode", + "settings" + ], + "properties": { + "mode": { + "$ref": "#/definitions/ModeKind" + }, + "settings": { + "$ref": "#/definitions/Settings" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "ModeKind": { + "description": "Initial collaboration mode to use when the TUI starts.", + "type": "string", + "enum": [ + "plan", + "default" + ] + }, + "NetworkAccess": { + "type": "string", + "enum": [ + "restricted", + "enabled" + ] + }, + "Personality": { + "type": "string", + "enum": [ + "none", + "friendly", + "pragmatic" + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "ReasoningSummary": { + "description": "A summary of the reasoning performed by the model. This can be useful for debugging and understanding the model's reasoning process. See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries", + "oneOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "description": "Option to disable reasoning summaries.", + "type": "string", + "enum": [ + "none" + ] + } + ] + }, + "SandboxPolicy": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "dangerFullAccess" + ], + "title": "DangerFullAccessSandboxPolicyType" + } + }, + "title": "DangerFullAccessSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "readOnly" + ], + "title": "ReadOnlySandboxPolicyType" + } + }, + "title": "ReadOnlySandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "networkAccess": { + "default": "restricted", + "allOf": [ + { + "$ref": "#/definitions/NetworkAccess" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "externalSandbox" + ], + "title": "ExternalSandboxSandboxPolicyType" + } + }, + "title": "ExternalSandboxSandboxPolicy" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "excludeSlashTmp": { + "default": false, + "type": "boolean" + }, + "excludeTmpdirEnvVar": { + "default": false, + "type": "boolean" + }, + "networkAccess": { + "default": false, + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "workspaceWrite" + ], + "title": "WorkspaceWriteSandboxPolicyType" + }, + "writableRoots": { + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/AbsolutePathBuf" + } + } + }, + "title": "WorkspaceWriteSandboxPolicy" + } + ] + }, + "Settings": { + "description": "Settings for a collaboration mode.", + "type": "object", + "required": [ + "model" + ], + "properties": { + "developer_instructions": { + "type": [ + "string", + "null" + ] + }, + "model": { + "type": "string" + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + } + } + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "TurnEnvironmentParams": { + "type": "object", + "required": [ + "cwd", + "environmentId" + ], + "properties": { + "cwd": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "environmentId": { + "type": "string" + } + } + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnStartResponse.json b/schemas/v2/TurnStartResponse.json new file mode 100644 index 0000000..36a3075 --- /dev/null +++ b/schemas/v2/TurnStartResponse.json @@ -0,0 +1,1684 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartResponse", + "type": "object", + "required": [ + "turn" + ], + "properties": { + "turn": { + "$ref": "#/definitions/Turn" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnStartedNotification.json b/schemas/v2/TurnStartedNotification.json new file mode 100644 index 0000000..aff1def --- /dev/null +++ b/schemas/v2/TurnStartedNotification.json @@ -0,0 +1,1688 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnStartedNotification", + "type": "object", + "required": [ + "threadId", + "turn" + ], + "properties": { + "threadId": { + "type": "string" + }, + "turn": { + "$ref": "#/definitions/Turn" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "CodexErrorInfo": { + "description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.", + "oneOf": [ + { + "type": "string", + "enum": [ + "contextWindowExceeded", + "usageLimitExceeded", + "serverOverloaded", + "cyberPolicy", + "internalServerError", + "unauthorized", + "badRequest", + "threadRollbackFailed", + "sandboxError", + "other" + ] + }, + { + "type": "object", + "required": [ + "httpConnectionFailed" + ], + "properties": { + "httpConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "HttpConnectionFailedCodexErrorInfo" + }, + { + "description": "Failed to connect to the response SSE stream.", + "type": "object", + "required": [ + "responseStreamConnectionFailed" + ], + "properties": { + "responseStreamConnectionFailed": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamConnectionFailedCodexErrorInfo" + }, + { + "description": "The response SSE stream disconnected in the middle of a turn before completion.", + "type": "object", + "required": [ + "responseStreamDisconnected" + ], + "properties": { + "responseStreamDisconnected": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseStreamDisconnectedCodexErrorInfo" + }, + { + "description": "Reached the retry limit for responses.", + "type": "object", + "required": [ + "responseTooManyFailedAttempts" + ], + "properties": { + "responseTooManyFailedAttempts": { + "type": "object", + "properties": { + "httpStatusCode": { + "type": [ + "integer", + "null" + ], + "format": "uint16", + "minimum": 0.0 + } + } + } + }, + "additionalProperties": false, + "title": "ResponseTooManyFailedAttemptsCodexErrorInfo" + }, + { + "description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.", + "type": "object", + "required": [ + "activeTurnNotSteerable" + ], + "properties": { + "activeTurnNotSteerable": { + "type": "object", + "required": [ + "turnKind" + ], + "properties": { + "turnKind": { + "$ref": "#/definitions/NonSteerableTurnKind" + } + } + } + }, + "additionalProperties": false, + "title": "ActiveTurnNotSteerableCodexErrorInfo" + } + ] + }, + "CollabAgentState": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "message": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/CollabAgentStatus" + } + } + }, + "CollabAgentStatus": { + "type": "string", + "enum": [ + "pendingInit", + "running", + "interrupted", + "completed", + "errored", + "shutdown", + "notFound" + ] + }, + "CollabAgentTool": { + "type": "string", + "enum": [ + "spawnAgent", + "sendInput", + "resumeAgent", + "wait", + "closeAgent" + ] + }, + "CollabAgentToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "CommandAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "command", + "name", + "path", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "read" + ], + "title": "ReadCommandActionType" + } + }, + "title": "ReadCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "listFiles" + ], + "title": "ListFilesCommandActionType" + } + }, + "title": "ListFilesCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "path": { + "type": [ + "string", + "null" + ] + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchCommandActionType" + } + }, + "title": "SearchCommandAction" + }, + { + "type": "object", + "required": [ + "command", + "type" + ], + "properties": { + "command": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "unknown" + ], + "title": "UnknownCommandActionType" + } + }, + "title": "UnknownCommandAction" + } + ] + }, + "CommandExecutionSource": { + "type": "string", + "enum": [ + "agent", + "userShell", + "unifiedExecStartup", + "unifiedExecInteraction" + ] + }, + "CommandExecutionStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "DynamicToolCallOutputContentItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputText" + ], + "title": "InputTextDynamicToolCallOutputContentItemType" + } + }, + "title": "InputTextDynamicToolCallOutputContentItem" + }, + { + "type": "object", + "required": [ + "imageUrl", + "type" + ], + "properties": { + "imageUrl": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "inputImage" + ], + "title": "InputImageDynamicToolCallOutputContentItemType" + } + }, + "title": "InputImageDynamicToolCallOutputContentItem" + } + ] + }, + "DynamicToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "FileUpdateChange": { + "type": "object", + "required": [ + "diff", + "kind", + "path" + ], + "properties": { + "diff": { + "type": "string" + }, + "kind": { + "$ref": "#/definitions/PatchChangeKind" + }, + "path": { + "type": "string" + } + } + }, + "HookPromptFragment": { + "type": "object", + "required": [ + "hookRunId", + "text" + ], + "properties": { + "hookRunId": { + "type": "string" + }, + "text": { + "type": "string" + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "McpToolCallError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "McpToolCallResult": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "_meta": true, + "content": { + "type": "array", + "items": true + }, + "structuredContent": true + } + }, + "McpToolCallStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed" + ] + }, + "MemoryCitation": { + "type": "object", + "required": [ + "entries", + "threadIds" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "$ref": "#/definitions/MemoryCitationEntry" + } + }, + "threadIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "MemoryCitationEntry": { + "type": "object", + "required": [ + "lineEnd", + "lineStart", + "note", + "path" + ], + "properties": { + "lineEnd": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "lineStart": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "note": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "MessagePhase": { + "description": "Classifies an assistant message as interim commentary or final answer text.\n\nProviders do not emit this consistently, so callers must treat `None` as \"phase unknown\" and keep compatibility behavior for legacy models.", + "oneOf": [ + { + "description": "Mid-turn assistant text (for example preamble/progress narration).\n\nAdditional tool calls or assistant output may follow before turn completion.", + "type": "string", + "enum": [ + "commentary" + ] + }, + { + "description": "The assistant's terminal answer text for the current turn.", + "type": "string", + "enum": [ + "final_answer" + ] + } + ] + }, + "NonSteerableTurnKind": { + "type": "string", + "enum": [ + "review", + "compact" + ] + }, + "PatchApplyStatus": { + "type": "string", + "enum": [ + "inProgress", + "completed", + "failed", + "declined" + ] + }, + "PatchChangeKind": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "add" + ], + "title": "AddPatchChangeKindType" + } + }, + "title": "AddPatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete" + ], + "title": "DeletePatchChangeKindType" + } + }, + "title": "DeletePatchChangeKind" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "move_path": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "update" + ], + "title": "UpdatePatchChangeKindType" + } + }, + "title": "UpdatePatchChangeKind" + } + ] + }, + "ReasoningEffort": { + "description": "See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning", + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "ThreadItem": { + "oneOf": [ + { + "type": "object", + "required": [ + "content", + "id", + "type" + ], + "properties": { + "content": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "userMessage" + ], + "title": "UserMessageThreadItemType" + } + }, + "title": "UserMessageThreadItem" + }, + { + "type": "object", + "required": [ + "fragments", + "id", + "type" + ], + "properties": { + "fragments": { + "type": "array", + "items": { + "$ref": "#/definitions/HookPromptFragment" + } + }, + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "hookPrompt" + ], + "title": "HookPromptThreadItemType" + } + }, + "title": "HookPromptThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "memoryCitation": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MemoryCitation" + }, + { + "type": "null" + } + ] + }, + "phase": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/MessagePhase" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "agentMessage" + ], + "title": "AgentMessageThreadItemType" + } + }, + "title": "AgentMessageThreadItem" + }, + { + "description": "EXPERIMENTAL - proposed plan item content. The completed plan item is authoritative and may not match the concatenation of `PlanDelta` text.", + "type": "object", + "required": [ + "id", + "text", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "plan" + ], + "title": "PlanThreadItemType" + } + }, + "title": "PlanThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "content": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "summary": { + "default": [], + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "ReasoningThreadItemType" + } + }, + "title": "ReasoningThreadItem" + }, + { + "type": "object", + "required": [ + "command", + "commandActions", + "cwd", + "id", + "status", + "type" + ], + "properties": { + "aggregatedOutput": { + "description": "The command's output, aggregated from stdout and stderr.", + "type": [ + "string", + "null" + ] + }, + "command": { + "description": "The command to be executed.", + "type": "string" + }, + "commandActions": { + "description": "A best-effort parsing of the command to understand the action(s) it will perform. This returns a list of CommandAction objects because a single shell command may be composed of many commands piped together.", + "type": "array", + "items": { + "$ref": "#/definitions/CommandAction" + } + }, + "cwd": { + "description": "The command's working directory.", + "allOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + } + ] + }, + "durationMs": { + "description": "The duration of the command execution in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "exitCode": { + "description": "The command's exit code.", + "type": [ + "integer", + "null" + ], + "format": "int32" + }, + "id": { + "type": "string" + }, + "processId": { + "description": "Identifier for the underlying PTY process (when available).", + "type": [ + "string", + "null" + ] + }, + "source": { + "default": "agent", + "allOf": [ + { + "$ref": "#/definitions/CommandExecutionSource" + } + ] + }, + "status": { + "$ref": "#/definitions/CommandExecutionStatus" + }, + "type": { + "type": "string", + "enum": [ + "commandExecution" + ], + "title": "CommandExecutionThreadItemType" + } + }, + "title": "CommandExecutionThreadItem" + }, + { + "type": "object", + "required": [ + "changes", + "id", + "status", + "type" + ], + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/FileUpdateChange" + } + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/PatchApplyStatus" + }, + "type": { + "type": "string", + "enum": [ + "fileChange" + ], + "title": "FileChangeThreadItemType" + } + }, + "title": "FileChangeThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "server", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "durationMs": { + "description": "The duration of the MCP tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "mcpAppResourceUri": { + "type": [ + "string", + "null" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/definitions/McpToolCallResult" + }, + { + "type": "null" + } + ] + }, + "server": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/McpToolCallStatus" + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mcpToolCall" + ], + "title": "McpToolCallThreadItemType" + } + }, + "title": "McpToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "arguments", + "id", + "status", + "tool", + "type" + ], + "properties": { + "arguments": true, + "contentItems": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/definitions/DynamicToolCallOutputContentItem" + } + }, + "durationMs": { + "description": "The duration of the dynamic tool call in milliseconds.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "id": { + "type": "string" + }, + "namespace": { + "type": [ + "string", + "null" + ] + }, + "status": { + "$ref": "#/definitions/DynamicToolCallStatus" + }, + "success": { + "type": [ + "boolean", + "null" + ] + }, + "tool": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dynamicToolCall" + ], + "title": "DynamicToolCallThreadItemType" + } + }, + "title": "DynamicToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "agentsStates", + "id", + "receiverThreadIds", + "senderThreadId", + "status", + "tool", + "type" + ], + "properties": { + "agentsStates": { + "description": "Last known status of the target agents, when available.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/CollabAgentState" + } + }, + "id": { + "description": "Unique identifier for this collab tool call.", + "type": "string" + }, + "model": { + "description": "Model requested for the spawned agent, when applicable.", + "type": [ + "string", + "null" + ] + }, + "prompt": { + "description": "Prompt text sent as part of the collab tool call, when available.", + "type": [ + "string", + "null" + ] + }, + "reasoningEffort": { + "description": "Reasoning effort requested for the spawned agent, when applicable.", + "anyOf": [ + { + "$ref": "#/definitions/ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "receiverThreadIds": { + "description": "Thread ID of the receiving agent, when applicable. In case of spawn operation, this corresponds to the newly spawned agent.", + "type": "array", + "items": { + "type": "string" + } + }, + "senderThreadId": { + "description": "Thread ID of the agent issuing the collab request.", + "type": "string" + }, + "status": { + "description": "Current status of the collab tool call.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentToolCallStatus" + } + ] + }, + "tool": { + "description": "Name of the collab tool that was invoked.", + "allOf": [ + { + "$ref": "#/definitions/CollabAgentTool" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "collabAgentToolCall" + ], + "title": "CollabAgentToolCallThreadItemType" + } + }, + "title": "CollabAgentToolCallThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "query", + "type" + ], + "properties": { + "action": { + "anyOf": [ + { + "$ref": "#/definitions/WebSearchAction" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "query": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "webSearch" + ], + "title": "WebSearchThreadItemType" + } + }, + "title": "WebSearchThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "path", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "path": { + "$ref": "#/definitions/AbsolutePathBuf" + }, + "type": { + "type": "string", + "enum": [ + "imageView" + ], + "title": "ImageViewThreadItemType" + } + }, + "title": "ImageViewThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "result", + "status", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "result": { + "type": "string" + }, + "revisedPrompt": { + "type": [ + "string", + "null" + ] + }, + "savedPath": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "status": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "imageGeneration" + ], + "title": "ImageGenerationThreadItemType" + } + }, + "title": "ImageGenerationThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "enteredReviewMode" + ], + "title": "EnteredReviewModeThreadItemType" + } + }, + "title": "EnteredReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "review", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "review": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "exitedReviewMode" + ], + "title": "ExitedReviewModeThreadItemType" + } + }, + "title": "ExitedReviewModeThreadItem" + }, + { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "contextCompaction" + ], + "title": "ContextCompactionThreadItemType" + } + }, + "title": "ContextCompactionThreadItem" + } + ] + }, + "Turn": { + "type": "object", + "required": [ + "id", + "items", + "status" + ], + "properties": { + "completedAt": { + "description": "Unix timestamp (in seconds) when the turn completed.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "durationMs": { + "description": "Duration between turn start and completion in milliseconds, if known.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "error": { + "description": "Only populated when the Turn's status is failed.", + "anyOf": [ + { + "$ref": "#/definitions/TurnError" + }, + { + "type": "null" + } + ] + }, + "id": { + "type": "string" + }, + "items": { + "description": "Thread items currently included in this turn payload.", + "type": "array", + "items": { + "$ref": "#/definitions/ThreadItem" + } + }, + "itemsView": { + "description": "Describes how much of `items` has been loaded for this turn.", + "default": "full", + "allOf": [ + { + "$ref": "#/definitions/TurnItemsView" + } + ] + }, + "startedAt": { + "description": "Unix timestamp (in seconds) when the turn started.", + "type": [ + "integer", + "null" + ], + "format": "int64" + }, + "status": { + "$ref": "#/definitions/TurnStatus" + } + } + }, + "TurnError": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "additionalDetails": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "codexErrorInfo": { + "anyOf": [ + { + "$ref": "#/definitions/CodexErrorInfo" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + } + }, + "TurnItemsView": { + "oneOf": [ + { + "description": "`items` was not loaded for this turn. The field is intentionally empty.", + "type": "string", + "enum": [ + "notLoaded" + ] + }, + { + "description": "`items` contains only a display summary for this turn.", + "type": "string", + "enum": [ + "summary" + ] + }, + { + "description": "`items` contains every ThreadItem available from persisted app-server history for this turn.", + "type": "string", + "enum": [ + "full" + ] + } + ] + }, + "TurnStatus": { + "type": "string", + "enum": [ + "completed", + "interrupted", + "failed", + "inProgress" + ] + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + }, + "WebSearchAction": { + "oneOf": [ + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "queries": { + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, + "query": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "search" + ], + "title": "SearchWebSearchActionType" + } + }, + "title": "SearchWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "openPage" + ], + "title": "OpenPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "OpenPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "pattern": { + "type": [ + "string", + "null" + ] + }, + "type": { + "type": "string", + "enum": [ + "findInPage" + ], + "title": "FindInPageWebSearchActionType" + }, + "url": { + "type": [ + "string", + "null" + ] + } + }, + "title": "FindInPageWebSearchAction" + }, + { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "title": "OtherWebSearchActionType" + } + }, + "title": "OtherWebSearchAction" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnSteerParams.json b/schemas/v2/TurnSteerParams.json new file mode 100644 index 0000000..f295026 --- /dev/null +++ b/schemas/v2/TurnSteerParams.json @@ -0,0 +1,218 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerParams", + "type": "object", + "required": [ + "expectedTurnId", + "input", + "threadId" + ], + "properties": { + "expectedTurnId": { + "description": "Required active turn id precondition. The request fails when it does not match the currently active turn.", + "type": "string" + }, + "input": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInput" + } + }, + "threadId": { + "type": "string" + } + }, + "definitions": { + "ByteRange": { + "type": "object", + "required": [ + "end", + "start" + ], + "properties": { + "end": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "start": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + } + }, + "ImageDetail": { + "type": "string", + "enum": [ + "high", + "original" + ] + }, + "TextElement": { + "type": "object", + "required": [ + "byteRange" + ], + "properties": { + "byteRange": { + "description": "Byte range in the parent `text` buffer that this element occupies.", + "allOf": [ + { + "$ref": "#/definitions/ByteRange" + } + ] + }, + "placeholder": { + "description": "Optional human-readable placeholder for the element, displayed in the UI.", + "type": [ + "string", + "null" + ] + } + } + }, + "UserInput": { + "oneOf": [ + { + "type": "object", + "required": [ + "text", + "type" + ], + "properties": { + "text": { + "type": "string" + }, + "text_elements": { + "description": "UI-defined spans within `text` used to render or persist special elements.", + "default": [], + "type": "array", + "items": { + "$ref": "#/definitions/TextElement" + } + }, + "type": { + "type": "string", + "enum": [ + "text" + ], + "title": "TextUserInputType" + } + }, + "title": "TextUserInput" + }, + { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "image" + ], + "title": "ImageUserInputType" + }, + "url": { + "type": "string" + } + }, + "title": "ImageUserInput" + }, + { + "type": "object", + "required": [ + "path", + "type" + ], + "properties": { + "detail": { + "default": null, + "anyOf": [ + { + "$ref": "#/definitions/ImageDetail" + }, + { + "type": "null" + } + ] + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "localImage" + ], + "title": "LocalImageUserInputType" + } + }, + "title": "LocalImageUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "skill" + ], + "title": "SkillUserInputType" + } + }, + "title": "SkillUserInput" + }, + { + "type": "object", + "required": [ + "name", + "path", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "mention" + ], + "title": "MentionUserInputType" + } + }, + "title": "MentionUserInput" + } + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/TurnSteerResponse.json b/schemas/v2/TurnSteerResponse.json new file mode 100644 index 0000000..61a912b --- /dev/null +++ b/schemas/v2/TurnSteerResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "TurnSteerResponse", + "type": "object", + "required": [ + "turnId" + ], + "properties": { + "turnId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/v2/WarningNotification.json b/schemas/v2/WarningNotification.json new file mode 100644 index 0000000..9899117 --- /dev/null +++ b/schemas/v2/WarningNotification.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WarningNotification", + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "Concise warning message for the user.", + "type": "string" + }, + "threadId": { + "description": "Optional thread target when the warning applies to a specific thread.", + "type": [ + "string", + "null" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/WindowsSandboxReadinessResponse.json b/schemas/v2/WindowsSandboxReadinessResponse.json new file mode 100644 index 0000000..193e3e0 --- /dev/null +++ b/schemas/v2/WindowsSandboxReadinessResponse.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxReadinessResponse", + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "$ref": "#/definitions/WindowsSandboxReadiness" + } + }, + "definitions": { + "WindowsSandboxReadiness": { + "type": "string", + "enum": [ + "ready", + "notConfigured", + "updateRequired" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/WindowsSandboxSetupCompletedNotification.json b/schemas/v2/WindowsSandboxSetupCompletedNotification.json new file mode 100644 index 0000000..a365b15 --- /dev/null +++ b/schemas/v2/WindowsSandboxSetupCompletedNotification.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupCompletedNotification", + "type": "object", + "required": [ + "mode", + "success" + ], + "properties": { + "error": { + "type": [ + "string", + "null" + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + }, + "success": { + "type": "boolean" + } + }, + "definitions": { + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/WindowsSandboxSetupStartParams.json b/schemas/v2/WindowsSandboxSetupStartParams.json new file mode 100644 index 0000000..7fcc455 --- /dev/null +++ b/schemas/v2/WindowsSandboxSetupStartParams.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartParams", + "type": "object", + "required": [ + "mode" + ], + "properties": { + "cwd": { + "anyOf": [ + { + "$ref": "#/definitions/AbsolutePathBuf" + }, + { + "type": "null" + } + ] + }, + "mode": { + "$ref": "#/definitions/WindowsSandboxSetupMode" + } + }, + "definitions": { + "AbsolutePathBuf": { + "description": "A path that is guaranteed to be absolute and normalized (though it is not guaranteed to be canonicalized or exist on the filesystem).\n\nIMPORTANT: When deserializing an `AbsolutePathBuf`, a base path must be set using [AbsolutePathBufGuard::new]. If no base path is set, the deserialization will fail unless the path being deserialized is already absolute.", + "type": "string" + }, + "WindowsSandboxSetupMode": { + "type": "string", + "enum": [ + "elevated", + "unelevated" + ] + } + } +} \ No newline at end of file diff --git a/schemas/v2/WindowsSandboxSetupStartResponse.json b/schemas/v2/WindowsSandboxSetupStartResponse.json new file mode 100644 index 0000000..5f83145 --- /dev/null +++ b/schemas/v2/WindowsSandboxSetupStartResponse.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsSandboxSetupStartResponse", + "type": "object", + "required": [ + "started" + ], + "properties": { + "started": { + "type": "boolean" + } + } +} \ No newline at end of file diff --git a/schemas/v2/WindowsWorldWritableWarningNotification.json b/schemas/v2/WindowsWorldWritableWarningNotification.json new file mode 100644 index 0000000..2046010 --- /dev/null +++ b/schemas/v2/WindowsWorldWritableWarningNotification.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WindowsWorldWritableWarningNotification", + "type": "object", + "required": [ + "extraCount", + "failedScan", + "samplePaths" + ], + "properties": { + "extraCount": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + }, + "failedScan": { + "type": "boolean" + }, + "samplePaths": { + "type": "array", + "items": { + "type": "string" + } + } + } +} \ No newline at end of file diff --git a/scripts/add-workspace b/scripts/add-workspace new file mode 100755 index 0000000..300ccee --- /dev/null +++ b/scripts/add-workspace @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +go run ./cmd/admin add-workspace "$@" diff --git a/scripts/allow-user b/scripts/allow-user new file mode 100755 index 0000000..4c55b35 --- /dev/null +++ b/scripts/allow-user @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +go run ./cmd/admin allow-user "$@" diff --git a/scripts/build-bot b/scripts/build-bot new file mode 100755 index 0000000..f141134 --- /dev/null +++ b/scripts/build-bot @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/.." +mkdir -p bin +CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o bin/codex-telegram-bot ./cmd/bot diff --git a/scripts/list-users b/scripts/list-users new file mode 100755 index 0000000..e523089 --- /dev/null +++ b/scripts/list-users @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +go run ./cmd/admin list-users "$@" diff --git a/scripts/list-workspaces b/scripts/list-workspaces new file mode 100755 index 0000000..f20ca12 --- /dev/null +++ b/scripts/list-workspaces @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +go run ./cmd/admin list-workspaces "$@" diff --git a/scripts/remove-user b/scripts/remove-user new file mode 100755 index 0000000..88b14ba --- /dev/null +++ b/scripts/remove-user @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +go run ./cmd/admin remove-user "$@" diff --git a/scripts/start-codex-app-server b/scripts/start-codex-app-server new file mode 100755 index 0000000..9da2839 --- /dev/null +++ b/scripts/start-codex-app-server @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +ENV_FILE="$ROOT/.env" +RUN_DIR="$ROOT/run" +PID_FILE="$RUN_DIR/codex-app-server.pid" +LOG_FILE="$RUN_DIR/codex-app-server.log" +STDIN_FIFO="$RUN_DIR/codex-app-server.stdin" + +read_env_value() { + local key="$1" + if [[ -f "$ENV_FILE" ]]; then + awk -F= -v key="$key" '$1 == key { sub(/^[^=]*=/, ""); print; exit }' "$ENV_FILE" + fi +} + +HOST_CODEX_SOCKET="${HOST_CODEX_SOCKET:-$(read_env_value HOST_CODEX_SOCKET)}" +HOST_CODEX_SOCKET="${HOST_CODEX_SOCKET:-$RUN_DIR/codex.sock}" + +mkdir -p "$RUN_DIR" +chmod 700 "$RUN_DIR" + +if [[ -f "$PID_FILE" ]]; then + old_pid="$(tr -cd '0-9' < "$PID_FILE" || true)" + if [[ -n "$old_pid" ]] && kill -0 "$old_pid" 2>/dev/null; then + if [[ -S "$HOST_CODEX_SOCKET" ]]; then + echo "codex app-server already running: pid=$old_pid socket=$HOST_CODEX_SOCKET" + exit 0 + fi + echo "pid $old_pid is running but socket is missing; refusing to start a second app-server" >&2 + exit 1 + fi + rm -f "$PID_FILE" +fi + +if [[ -e "$HOST_CODEX_SOCKET" ]]; then + if [[ -S "$HOST_CODEX_SOCKET" ]]; then + rm -f "$HOST_CODEX_SOCKET" + else + echo "socket path exists and is not a Unix socket: $HOST_CODEX_SOCKET" >&2 + exit 1 + fi +fi + +rm -f "$STDIN_FIFO" +mkfifo "$STDIN_FIFO" +chmod 600 "$STDIN_FIFO" + +: > "$LOG_FILE" +# Codex app-server currently exits if detached with stdin closed. A detached +# wrapper keeps a private FIFO writer open and then runs Codex on the host. +setsid -f bash -c ' + echo "$$" > "$3" + tail -f /dev/null > "$1" & + writer=$! + trap "kill $writer 2>/dev/null || true" EXIT + codex app-server --listen "$2" < "$1" +' codex-app-server "$STDIN_FIFO" "unix://$HOST_CODEX_SOCKET" "$PID_FILE" >> "$LOG_FILE" 2>&1 + +for _ in $(seq 1 50); do + if [[ -f "$PID_FILE" ]]; then + break + fi + sleep 0.1 +done + +pid="$(tr -cd '0-9' < "$PID_FILE" 2>/dev/null || true)" +if [[ -z "$pid" ]]; then + echo "codex app-server did not write a pid file; log follows:" >&2 + sed -n '1,120p' "$LOG_FILE" >&2 || true + exit 1 +fi + +for _ in $(seq 1 100); do + if [[ -S "$HOST_CODEX_SOCKET" ]]; then + sleep 0.5 + if kill -0 "$pid" 2>/dev/null; then + echo "codex app-server started: pid=$pid socket=$HOST_CODEX_SOCKET log=$LOG_FILE" + exit 0 + fi + fi + if ! kill -0 "$pid" 2>/dev/null; then + echo "codex app-server exited before staying ready; log follows:" >&2 + sed -n '1,120p' "$LOG_FILE" >&2 || true + rm -f "$PID_FILE" + exit 1 + fi + sleep 0.1 +done + +echo "codex app-server did not create socket within 10 seconds; log follows:" >&2 +sed -n '1,120p' "$LOG_FILE" >&2 || true +exit 1