Skip to main content

Module headless

Module headless 

Source
Expand description

jev with no terminal in the way: a page in, an answer page out.

The REPL is the place to shape a request; once it is shaped, the same session is something a script wants — in a pipe, in a Makefile, in CI. Everything here is the pure half of that: text in, text out, no terminal and no process, so a test can drive it without a PTY.

let session = headless::load("A payout failed.\n---\nis_urgent? Conveys urgency").unwrap();
println!("{}", headless::request_text(&session, "jev-latest"));

Constants§

COMMANDS
The subcommands that run without a terminal, and what each one prints.

Functions§

answers_json
The raw body, for --json: what arrived live, or the shape a mock answer would have arrived in.
answers_text
The answer page: the same bars and labels the REPL draws, minus the colour.
cached_answers
The answers a cached body carries, lined up with the questions that were asked.
check_text
What jev check says about a page: every problem, not just the first.
code_text
The session as code, for jev rust.
cost_text
The token table, priced when rates were supplied.
is_command
Whether word names a subcommand, so jev <word> is not mistaken for a flag or a path.
live_answers
The answers a live response carries, lined up with the questions that were asked.
load
Read a session from a sketch page or a request body.
mock_answers
Simulated answers, the same deterministic ones the REPL shows offline.
request_text
The exact body the SDK would POST.
sendable
Why this session cannot be sent yet, if it cannot.
usage_text
The one-line footer under an answer page: tokens, and money when the rates are known.

Type Aliases§

Answered
One question’s answer, or None when nothing answered it.