Skip to main content

Module beholders

Module beholders 

Source
Expand description

Beholder framework — observer-side parsers and rewriters for structured output.

A beholder attaches to a TaskRun at spawn time and turns raw output chunks into structured Event rows. There are two modes:

  • Rewriter: mutates argv before the subprocess starts (e.g. cargo gets --message-format=json-render-diagnostics).
  • Parser: reads human-formatted output and scrapes events out of it.

§Integration point

let result = registry.attach(raw_cmd, &BeholderSelect::Auto, tty_attached);
// spawn the process with result.argv (may be rewritten)
// for each chunk captured:
if let Some(b) = result.beholder.as_mut() {
    for event in b.parse_chunk(&chunk) {
        store.append_event(run_id, ...);
    }
}
// persist result.status on the run:
store.update_beholder_status(run_id, &result.status)?;

Structs§

AttachResult
Returned by BeholderRegistry::attach.
BeholderRegistry
Registry of available beholders, consulted at task.run time.
BiomeBeholder
Per-run Biome JSON parser. Buffers all output; parses in on_done.
BiomeBeholderFactory
Factory for the bundled Biome beholder (Tier 1.5, Rewriter mode).
BunTestBeholderFactory
Factory for the bundled bun-test beholder (Tier 1.5, Rewriter mode).
CargoBeholder
Per-run cargo JSON parser.
CargoBeholderFactory
Factory for the bundled cargo beholder (Tier 1.5, Rewriter mode).
EslintBeholder
Per-run ESLint JSON parser. Buffers all output; parses in on_done.
EslintBeholderFactory
Factory for the bundled ESLint beholder (Tier 1.5, Rewriter mode).
JestBeholderFactory
Factory for the bundled jest beholder (Tier 1.5, Rewriter mode).
JsTestBeholder
Per-run JS test JSON parser shared by vitest, jest, and bun-test.
PytestBeholder
Per-run pytest text-output parser.
PytestBeholderFactory
Factory for the bundled pytest beholder (Tier 1.5, Parser mode).
ToolVersionRange
Declared support range for the tool’s structured-output schema (not the beholder’s own version). Used to surface unknown_format when drift is detected at parse time.
TscBeholder
Per-run tsc parser.
TscBeholderFactory
Factory for the bundled tsc beholder (Tier 1.5, Rewriter + Parser).
ViteBuildBeholder
Per-run vite build output parser.
ViteBuildBeholderFactory
Factory for the bundled vite-build beholder (Tier 1.5, Parser mode).
VitestBeholderFactory
Factory for the bundled vitest beholder (Tier 1.5, Rewriter mode).

Enums§

BeholderMode
Whether a beholder modifies the invocation (rewriter) or reads human output (parser).
BeholderSelect
Caller-supplied attachment policy for task.run.

Traits§

Beholder
Per-run stateful chunk processor.
BeholderFactory
Static descriptor + factory for a beholder type. Held in the registry.

Functions§

default_registry
Construct a BeholderRegistry pre-loaded with all bundled beholders.
registry_with_user_beholders
Construct a BeholderRegistry with bundled beholders plus any user-defined beholders loaded from user_dir (typically ~/.yah/beholders/).
resolve_argv
Tokenize raw_cmd and strip common wrapper binaries so beholders see the bare tool name as argv[0].