TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Effectful-Tech/clanka/llms.txt
Use this file to discover all available pages before exploring further.
OutputFormatter module turns the raw event stream produced by a Clanka agent into coloured, human-readable text. It ships one formatter — pretty — and a Muxer service for interleaving output from multiple concurrent agents.
Type
OutputFormatter is a Stream pipeline operator. It consumes a Stream<Output, AgentFinished | E, R> and returns a Stream<string, Exclude<E, AgentFinished>, R>. The AgentFinished error channel is consumed internally and rendered as a completion message.
pretty(options?)
The built-in formatter. Call it once to produce an OutputFormatter you can pipe your agent stream through.
Controls how many lines of script output are shown before a truncation notice is appended.
- Omitted or
false— no truncation (default). true— truncate to 20 lines (the built-in default when enabled).number— truncate to exactly that many lines.
\n... (truncated, total N lines) to the output.A stream operator
Stream<Output, AgentFinished | E, R> → Stream<string, Exclude<E, AgentFinished>, R>.Usage
Output event rendering
pretty maps each Output event tag to a styled string. The table below documents every tag and the text it produces.
| Tag | Rendered as |
|---|---|
AgentStart | Bold green heading with agent ID, model/provider, and the prompt text. |
ReasoningStart | Bold yellow “Thinking:” heading followed by a space. |
ReasoningDelta | The raw reasoning delta text (streamed inline). |
ReasoningEnd | Two newlines to close the reasoning block. |
ScriptStart | Bold blue “Executing script” heading. |
ScriptDelta | Dimmed script source delta (streamed inline). |
ScriptEnd | Two newlines to close the script block. |
ScriptOutput | Bold blue “Script output” heading followed by the (possibly truncated) output text in dim style. |
ErrorRetry | Red “Error: … Retrying…” message with a full Cause pretty-print below. |
Usage | Cyan token-count summary: context / input / output. |
SubagentStart | Bold magenta heading with subagent ID, model/provider, and dim prompt. |
SubagentComplete | Bold magenta heading with subagent ID and its completion summary. |
SubagentPart | Magenta “Subagent #N:” prefix prepended to the inner part’s formatted output. |
AgentFinished (error channel) | Bold green “Task complete:” heading followed by the summary. |
Muxer service
Muxer multiplexes output from several concurrent agent streams into a single Stream<string>, serialising multi-line blocks so that reasoning and script sections from different agents are never interleaved mid-block.
Builds the
Muxer layer from any OutputFormatter. Typically called with pretty(options).Example
Muxer is a scoped resource. Agent streams are forked into the enclosing scope via Effect.forkIn, so they are automatically cleaned up when the scope closes.