Skip to main content

Module input

Module input 

Source
Expand description

StatusContext is the canonical, tool-agnostic model parsed from a statusline JSON payload (Claude Code today; per-tool normalizers are added as other tools wire in). Rate-limit windows live on DataContext::usage() and are not parsed from stdin; see docs/specs/input-schema.md for the full contract.

Structs§

ContextWindow
CostMetrics
GitWorktree
ModelInfo
OutputStyle
Active output style. Kept as a struct (rather than collapsing to Option<String>) so name can later evolve to an enum with a Custom(String) variant without breaking downstream type signatures. See ADR-0008.
ParseOpts
Caller-side hooks for parse_with_opts.
Percent
Percentage in 0.0..=100.0. Construction outside that range returns None so normalizers can translate to ParseError::InvalidValue.
SourcePos
StatusContext
The canonical, tool-agnostic input to the rendering pipeline. Arc around raw keeps StatusContext::clone at O(1) when segments cache.
TurnUsage
Per-turn token breakdown from context_window.current_usage. All counts are for the most recent API call only — use ContextWindow’s total_*_tokens for cumulative session values.
WorkspaceInfo

Enums§

EffortLevel
JsonType
ParseError
Tool
Tool::Other(s) is intentionally NOT canonicalized: it compares unequal to a known variant even when s.eq_ignore_ascii_case("claude"). Supply runtime-detected tool names through the public entry points (parse_with_opts with ParseOpts::with_tool, or the LINESMITH_TOOL env var) — the internal alias table folds known names into canonical variants before reaching Other, so direct Tool::Other("claude")-style construction is a contract violation.
VimMode
Vim editing mode reflected from Claude Code’s vim.mode field. Command is Vim’s :-prefix command-line buffer, not “a command was run”.

Functions§

parse
Parse a statusline JSON payload into a StatusContext.
parse_with_opts
Parse a statusline JSON payload into a StatusContext with caller hooks. Tool detection follows the precedence in docs/specs/input-schema.md §“Heuristic detection”: opts override → LINESMITH_TOOL env → shape heuristic → Fallback (ClaudeCode).