pub struct CodexProjector {
pub cwd: Option<String>,
pub model: Option<String>,
pub originator: Option<String>,
pub cli_version: Option<String>,
}Expand description
Project a ConversationView into a Codex crate::types::Session.
Config fields are optional. Defaults match what Codex itself would write for a fresh CLI invocation.
§Example
use toolpath_codex::project::CodexProjector;
use toolpath_convo::{ConversationProjector, ConversationView};
let view = ConversationView {
id: "session-uuid".into(),
provider_id: Some("codex".into()),
..Default::default()
};
let session = CodexProjector::default().project(&view).unwrap();
assert_eq!(session.id, "session-uuid");
// Always at least the session_meta line.
assert!(!session.lines.is_empty());Fields§
§cwd: Option<String>Session cwd. Falls back to the first turn’s environment, then /.
model: Option<String>Default model for the turn_context line. Falls back to the
first assistant turn’s Turn.model, then "unknown".
originator: Option<String>originator field on the session_meta line. Defaults to
"codex-toolpath" so Codex-side tooling can tell projected
sessions from real ones at a glance.
cli_version: Option<String>CLI version string for session_meta.cli_version.
Implementations§
Trait Implementations§
Source§impl Clone for CodexProjector
impl Clone for CodexProjector
Source§fn clone(&self) -> CodexProjector
fn clone(&self) -> CodexProjector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodexProjector
impl Debug for CodexProjector
Source§impl Default for CodexProjector
impl Default for CodexProjector
Source§fn default() -> CodexProjector
fn default() -> CodexProjector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodexProjector
impl RefUnwindSafe for CodexProjector
impl Send for CodexProjector
impl Sync for CodexProjector
impl Unpin for CodexProjector
impl UnsafeUnpin for CodexProjector
impl UnwindSafe for CodexProjector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more