Skip to main content

parse

Function parse 

Source
pub fn parse(input: &[u8]) -> Result<StatusContext, ParseError>
Expand description

Parse a Claude Code statusline JSON payload into a StatusContext.

Currently dispatches to the Claude normalizer unconditionally; tool-detection heuristics are added when a second tool is wired in.

§Errors

Per ADR-0014, sub-field failures degrade to Option::None with lsm_warn! rather than propagating through Result. parse only returns Err for catastrophic failures: ParseError::InvalidJson on malformed JSON, TypeMismatch when the root is not a JSON object, and InvalidValue for a used_percentage < 0 (carve-out for undocumented CC corruption signals; NaN is rejected upstream by serde_json as InvalidJson).