PromptRunner.Rendering (PromptRunnerSDK v0.12.1)

Copy Markdown View Source

Renders prompt-runner canonical event streams through a pluggable renderer and sink pipeline.

Summary

Types

What a boundary hook may ask the pipeline to do after an event.

Types

command()

@type command() :: {:set_view, map()} | {:renderer, renderer_spec()}

What a boundary hook may ask the pipeline to do after an event.

{:set_view, view} reaches the live renderer through PromptRunner.Rendering.Renderer.set_view/2; {:renderer, spec} replaces the renderer outright, which is what a log_mode change means.

opts()

@type opts() :: [
  renderer: renderer_spec(),
  sinks: [sink_spec()],
  boundary: (map() -> [command()])
]

renderer_spec()

@type renderer_spec() :: {module(), PromptRunner.Rendering.Renderer.opts()}

sink_spec()

@type sink_spec() :: {module(), PromptRunner.Rendering.Sink.opts()}

Functions

stream(event_stream, opts)

@spec stream(Enumerable.t(), opts()) :: :ok | {:error, term()}