Skip to main content

kcode_codex_runtime_v2/
lib.rs

1//! Native Codex app-server turns with caller-implemented dynamic tools.
2//!
3//! [`Codex::start_turn`] preserves the standard text-and-dynamic-tool flow.
4//! [`Codex::start_image_turn`] is a separate fresh, ephemeral, tool-free flow
5//! that sends caller-owned image bytes as inline data URLs.
6//!
7//! [`AgentTurn`] yields exact client-to-Codex JSONL records, dynamic tool
8//! calls, and the completed turn. For an image turn, the `turn/start`
9//! [`AgentEvent::ProviderInput`] contains the Base64-encoded image bytes and
10//! must be handled as media-bearing data.
11
12#![deny(missing_docs)]
13#![forbid(unsafe_code)]
14
15mod error;
16mod model;
17mod runtime;
18
19pub use error::{Error, ErrorKind, Result};
20pub use model::{
21    AgentEvent, AgentRequest, CompletedTurn, DynamicTool, DynamicToolCall, ImageInput,
22    ImageMediaType, ImageTurnRequest, ReasoningEffort, TokenUsage, ToolResult,
23};
24pub use runtime::{AgentTurn, Codex, CodexConfig, DEFAULT_CODEX_EXECUTABLE};