What mix juggernaut writes while a run goes and when it ends (design notes §5): a pure
reducer over the engine's run events (Juggernaut.View.Stream.event/0).
--stream: every event becomes its NDJSON lines on stdout (Juggernaut.View.Stream); with--format agentthe last line holds the agent document (eventreport). Nothing else goes to stdout.human: the live view (Juggernaut.View.Live): progress on stderr, each survivor as it is found and the summary on stdout.agent,json,markdown,github: the live view's stderr lines only; the format's document is written once, at the end (document/2), so stdout holds that document alone.
handle/3 returns the writes, in order, as {:stdout | :stderr, iodata}.
Summary
Functions
The whole document of run in the output's format (for --output PATH).
What to write to stdout once the run has finished: nothing for human and for
--stream (both already wrote it), else the format's document.
Takes one event at t_ms (milliseconds since the run started).
An output for format. Options: stream (NDJSON, default false), tty (redraw the
progress line; never with stream) and the view options of Juggernaut.View.
Replaces view options (for example the sources, once the plan names the files).
Types
@type format() :: :human | :agent | :json | :markdown | :github
@type t() :: %Juggernaut.CLI.RunOutput{ format: format(), live: Juggernaut.View.Live.t(), opts: Juggernaut.View.options(), run_id: String.t() | nil, stream?: boolean() }
@type write() :: {:stdout | :stderr, iodata()}
Functions
@spec document(t(), Juggernaut.Run.t()) :: iodata()
The whole document of run in the output's format (for --output PATH).
@spec final(t(), Juggernaut.Run.t()) :: iodata()
What to write to stdout once the run has finished: nothing for human and for
--stream (both already wrote it), else the format's document.
@spec handle(t(), Juggernaut.View.Stream.event(), non_neg_integer()) :: {[write()], t()}
Takes one event at t_ms (milliseconds since the run started).
An output for format. Options: stream (NDJSON, default false), tty (redraw the
progress line; never with stream) and the view options of Juggernaut.View.
Replaces view options (for example the sources, once the plan names the files).