Documentation
¶
Index ¶
- Constants
- func AppendStreamItemText(builder *strings.Builder, currentItemID *string, text, itemID string)
- func EffectiveDisplay(cfg config.ReasoningConfig) string
- func ExportRaw(cfg config.ReasoningConfig) bool
- func ExportSummaries(cfg config.ReasoningConfig) bool
- func HistoryExpanded(kind string, cfg config.ReasoningConfig) bool
- func HistoryMode(cfg config.ReasoningConfig) string
- func HistoryVisible(kind string, cfg config.ReasoningConfig) bool
- func IsDisplayable(kind string, cfg config.ReasoningConfig) bool
- func LimitReasoningText(kind string, text string, cfg config.ReasoningConfig) string
- func NormalizeKind(kind string) string
- func RawDisplayBlocked(cfg config.ReasoningConfig) bool
- func SourceAllowsProviderThinking(cfg config.ReasoningConfig) bool
- func SourceAllowsRaw(cfg config.ReasoningConfig) bool
- func SourceAllowsSummary(cfg config.ReasoningConfig) bool
- func StatusEnabled(cfg config.ReasoningConfig) bool
- func SummaryBody(text string, cfg config.ReasoningConfig) string
- func SummaryTitle(text string, cfg config.ReasoningConfig) string
- func TruncateRunes(text string, maxRunes int) string
- type ParsedReasoningSummary
Constants ¶
const ( KindUnknown = "unknown" KindSummary = "summary" KindRaw = "raw" KindEncrypted = "encrypted" )
const MaxReasoningTitleRunes = 80
Variables ¶
This section is empty.
Functions ¶
func AppendStreamItemText ¶ added in v0.0.328
AppendStreamItemText appends a streamed reasoning delta while preserving the paragraph boundary between distinct provider reasoning items. Deltas from the same item are appended verbatim because markdown tokens may span deltas.
func EffectiveDisplay ¶
func EffectiveDisplay(cfg config.ReasoningConfig) string
EffectiveDisplay resolves display=auto to the current concrete behavior and applies the raw safety gate. If raw display is requested without raw=true, it falls back to collapsed summary display.
func ExportRaw ¶
func ExportRaw(cfg config.ReasoningConfig) bool
func ExportSummaries ¶
func ExportSummaries(cfg config.ReasoningConfig) bool
func HistoryExpanded ¶
func HistoryExpanded(kind string, cfg config.ReasoningConfig) bool
func HistoryMode ¶
func HistoryMode(cfg config.ReasoningConfig) string
func HistoryVisible ¶
func HistoryVisible(kind string, cfg config.ReasoningConfig) bool
func IsDisplayable ¶
func IsDisplayable(kind string, cfg config.ReasoningConfig) bool
IsDisplayable reports whether classified, non-encrypted reasoning can be shown for the resolved interactive UI policy. Encrypted and unknown content remain hidden. Export has a separate stricter raw gate.
func LimitReasoningText ¶
func LimitReasoningText(kind string, text string, cfg config.ReasoningConfig) string
func NormalizeKind ¶
func RawDisplayBlocked ¶
func RawDisplayBlocked(cfg config.ReasoningConfig) bool
RawDisplayBlocked reports display=raw was requested without the explicit raw gate. Chat uses this to show a one-time warning while falling back to the normal collapsed interactive thought UI.
func SourceAllowsProviderThinking ¶
func SourceAllowsProviderThinking(cfg config.ReasoningConfig) bool
SourceAllowsProviderThinking reports whether interactive surfaces may show provider-marked non-encrypted thinking blocks. This is intentionally broader than SourceAllowsRaw: raw export/replay still requires source=all, while the default summary_or_provider_safe source permits provider-classified thinking to render as a normal collapsed Thought/Thinking block.
func SourceAllowsRaw ¶
func SourceAllowsRaw(cfg config.ReasoningConfig) bool
func SourceAllowsSummary ¶
func SourceAllowsSummary(cfg config.ReasoningConfig) bool
func StatusEnabled ¶
func StatusEnabled(cfg config.ReasoningConfig) bool
func SummaryBody ¶
func SummaryBody(text string, cfg config.ReasoningConfig) string
func SummaryTitle ¶
func SummaryTitle(text string, cfg config.ReasoningConfig) string
func TruncateRunes ¶
Types ¶
type ParsedReasoningSummary ¶
ParsedReasoningSummary is the display-oriented shape of provider-sanctioned reasoning summary text.
func ParseReasoningSummary ¶
func ParseReasoningSummary(text string) ParsedReasoningSummary
ParseReasoningSummary extracts an optional leading bold title block from a displayable reasoning summary. It recognizes Markdown of the form:
**Title** Body
and the streaming partial form "**Title**". Ordinary inline bold prefixes such as "**Important:** keep this" are left untouched as body text.