Documentation
¶
Overview ¶
Package message builds the LLM prompt for a commit message and sanitizes the model's response. It is pure: no I/O, no environment, no process execution.
Index ¶
Constants ¶
const ( TypePlain = "plain" TypeConventional = "conventional" TypeGitmoji = "gitmoji" )
Commit message format types. These are the only values csp generates for; the "+body" variants of earlier versions were dropped because csp always produces a single-line message.
Variables ¶
This section is empty.
Functions ¶
func BuildPrompt ¶
BuildPrompt builds the system prompt sent to the LLM for the given locale, maximum commit-message length, commit message type and optional user-supplied custom prompt fragment.
func Sanitize ¶
Sanitize turns a raw model response into a single-line commit message.
It does NOT strip Markdown code fences: that is the codex layer's responsibility (and applies to the pr command too), whereas Sanitize is only applied to generated commit messages. The steps are: remove <think> blocks, keep the first line, drop a trailing period, strip surrounding quotes, and strip a leading tag.
Types ¶
This section is empty.