Documentation
¶
Overview ¶
Package prompttext decides what part of a recorded user turn is a prompt somebody actually typed.
It lives on its own because two places need the same answer and they must not drift: the Claude Code adapter uses it at parse time to pick which record wins a turn, and the analytics read path uses it to choose which turn to show as "the prompt that produced this commit". Restating the rule in SQL for the second would give the product two definitions of the same thing, and the symptom of a disagreement is not an error — it is a commit page confidently captioned "/model".
Pure functions over strings, no I/O. Reviewed as data, like the price table.
Index ¶
Constants ¶
const AppMessageLead = "Your user sent this from the baum desktop app, in place of typing it in this terminal:"
AppMessageLead is how a message the baum desktop app sends to a Claude Code session opens, so the agent knows its user sent it: Claude Code tells its model that a message on its inbox came from another session. The person typed only what follows it.
Variables ¶
This section is empty.
Functions ¶
func IsBoilerplate ¶
IsBoilerplate reports whether text is only wrapper constructs, and so describes no prompt a person actually typed.
func Preview ¶
Preview is the stripped prose, cut to limit characters.
Characters, not bytes: a byte-wise cut splits a multi-byte rune and produces a replacement character in the middle of a word. The cut also backs up to the last space when one is near enough, because a preview ending mid-word reads as corruption rather than as truncation.
Types ¶
This section is empty.