API, extension, hook, MCP, and trace schemas
This stage is shared behind-the-scenes support. It does not drive startup, the main agent loop, or shutdown by itself. Instead, it defines the public message shapes that many parts of the system must agree on, like standard forms used by different departments.
The code-mode contract types describe how code execution sessions, runtime messages, tool descriptions, and results such as text or images are represented. The public API schemas define requests, responses, errors, streaming events, search payloads, image payloads, and realtime WebSocket messages for outside services. The extension and hook contracts give plugins safe, stable ways to receive events, store state, add context, and declare hook commands. The tool and protocol schemas describe model-visible tool calls, permission requests, plans, human questions, and shared result formats. The MCP, exec, and sandbox wire models define exact messages that cross process boundaries, including command execution, event streams, and permission escalation. Finally, the rollout trace models describe saved histories of agent runs, with sessions, runtime events, and references to large payloads. Together, these schemas keep independent pieces speaking the same language.