Documentation
¶
Overview ¶
Package send consolidates prompt detection and send verification functions used by both the CLI send path (session_cmd.go) and the Instance send path (instance.go). Having a single source of truth prevents fix divergence.
Index ¶
- func CurrentComposerPrompt(content string) (string, bool)
- func HasCurrentComposerPrompt(content string) bool
- func HasUnsentComposerPrompt(content, message string) bool
- func HasUnsentPastedPrompt(content string) bool
- func IsComposerDividerLine(line string) bool
- func NormalizePromptText(s string) string
- func ParsePromptFromComposerBlock(lines []string) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentComposerPrompt ¶
CurrentComposerPrompt extracts the current prompt text from the composer region at the bottom of the terminal pane. It searches for the last two divider lines and parses the prompt between them, with a fallback for layouts without dividers.
func HasCurrentComposerPrompt ¶
HasCurrentComposerPrompt returns true if a composer prompt is visible in the terminal pane content.
func HasUnsentComposerPrompt ¶
HasUnsentComposerPrompt detects when the message text is still present in the interactive input line (e.g., "❯ message"), which indicates Enter was not accepted yet even if no "[Pasted text ...]" marker is shown.
func HasUnsentPastedPrompt ¶
HasUnsentPastedPrompt detects Claude's composer marker for a pasted-but-unsent prompt. Example: "[Pasted text #1 +89 lines]".
func IsComposerDividerLine ¶
IsComposerDividerLine detects composer divider lines made of dash characters. Requires at least 10 consecutive dash-like characters (─, -, ━).
func NormalizePromptText ¶
NormalizePromptText normalizes whitespace in prompt text by replacing NBSP with regular spaces, trimming, and collapsing multiple whitespace runs.
func ParsePromptFromComposerBlock ¶
ParsePromptFromComposerBlock parses the prompt text from a composer block (the lines between two divider lines). It looks for a prompt marker (❯ or ›) and collects any wrapped continuation lines.
Types ¶
This section is empty.