Skip to content

Function: renderPrompt()

renderPrompt(items, corrections, policy, options): ComposedIntent

Defined in: aiui-lowering-pipeline/src/render.ts:37

Pass 5 — render: fold the placed/interleaved items into the transcript and the lowered prompt body, plus the PromptSpan annotations over that body. The prompt text is byte-identical to the pre-spans renderer; spans is additive metadata a consumer may ignore.

Spans are produced HERE because this is the one place that knows every part's rendered text and its offset. Offsets are derived from the assembled string (a running cursor that folds in each part's separator — a single space between inline runs, one blank line around a multi-line block — then shifted by the leading trim) so the final .trim() can never desync them.

Parameters

items

ComposedItem[]

corrections

object[]

policy

"replace" | "note"

options

ComposeOptions

Returns

ComposedIntent