pub struct CodexJsonl { /* private fields */ }Expand description
Adapter for OpenAI Codex CLI session .jsonl files (spec-067 §9 Phase 3).
Strict and version-pinned: only "type": "response_item" records with
payload.type == "message" and payload.role in ["user", "assistant"] are
processed. Records with role == "developer" (system instructions) are skipped.
Unknown structure in a response_item causes an Err.
Project-scope enforcement (only files whose session_meta.payload.cwd matches the
current project root) is performed by the binary layer, not this adapter.
§Examples
use zeph_memory::graph::ingest::{CodexJsonl, IngestSourceAdapter, ImportBatchId};
let raw = concat!(
r#"{"type":"session_meta","payload":{"id":"s1","cwd":"/project"}}"#, "\n",
r#"{"type":"response_item","payload":{"type":"message","role":"user","id":"i1","content":[{"type":"input_text","text":"hello"}]}}"#
);
let adapter = CodexJsonl::new("session-1");
let batch = ImportBatchId::new();
let docs = adapter.parse(raw, &batch).unwrap();
assert_eq!(docs.len(), 1);Implementations§
Source§impl CodexJsonl
impl CodexJsonl
Trait Implementations§
Source§impl IngestSourceAdapter for CodexJsonl
impl IngestSourceAdapter for CodexJsonl
Source§fn parse(
&self,
raw: &str,
batch_id: &ImportBatchId,
) -> Result<Vec<IngestDocument>, MemoryError>
fn parse( &self, raw: &str, batch_id: &ImportBatchId, ) -> Result<Vec<IngestDocument>, MemoryError>
Parse a Codex CLI .jsonl session file.
Skips session_meta, developer-role messages, and all other non-message
record types silently. A response_item record whose payload is missing or
structurally invalid causes Err.
Auto Trait Implementations§
impl Freeze for CodexJsonl
impl RefUnwindSafe for CodexJsonl
impl Send for CodexJsonl
impl Sync for CodexJsonl
impl Unpin for CodexJsonl
impl UnsafeUnpin for CodexJsonl
impl UnwindSafe for CodexJsonl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request