pub struct EventParser { /* private fields */ }Expand description
Parser for extracting events from CLI output.
Implementations§
Source§impl EventParser
impl EventParser
Sourcepub fn with_source(self, source: impl Into<HatId>) -> Self
pub fn with_source(self, source: impl Into<HatId>) -> Self
Sets the source hat for parsed events.
Sourcepub fn parse(&self, output: &str) -> Vec<Event>
pub fn parse(&self, output: &str) -> Vec<Event>
Parses events from CLI output text.
Returns a list of parsed events.
Sourcepub fn parse_backpressure_evidence(
payload: &str,
) -> Option<BackpressureEvidence>
pub fn parse_backpressure_evidence( payload: &str, ) -> Option<BackpressureEvidence>
Parses backpressure evidence from build.done event payload.
Expected format:
tests: pass
lint: pass
typecheck: passNote: ANSI escape codes are stripped before parsing to handle colorized CLI output.
Sourcepub fn parse_review_evidence(payload: &str) -> Option<ReviewEvidence>
pub fn parse_review_evidence(payload: &str) -> Option<ReviewEvidence>
Parses review evidence from review.done event payload.
Expected format (subset of backpressure evidence):
tests: pass
build: passNote: ANSI escape codes are stripped before parsing.
Sourcepub fn contains_promise(output: &str, promise: &str) -> bool
pub fn contains_promise(output: &str, promise: &str) -> bool
Checks if output contains the completion promise.
Per spec: The promise must appear in the agent’s final output,
not inside an <event> tag payload. This function:
- Returns false if the promise appears inside ANY event tag (prevents accidental completion when agents discuss the promise)
- Otherwise, checks for the promise in the stripped output
Checks if the promise appears inside any event tag payload.
Trait Implementations§
Source§impl Debug for EventParser
impl Debug for EventParser
Source§impl Default for EventParser
impl Default for EventParser
Source§fn default() -> EventParser
fn default() -> EventParser
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EventParser
impl RefUnwindSafe for EventParser
impl Send for EventParser
impl Sync for EventParser
impl Unpin for EventParser
impl UnwindSafe for EventParser
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
Source§impl<T> Erasable for T
impl<T> Erasable for T
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 more