send

package
v1.9.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: MIT Imports: 1 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentComposerPrompt

func CurrentComposerPrompt(content string) (string, bool)

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

func HasCurrentComposerPrompt(content string) bool

HasCurrentComposerPrompt returns true if a composer prompt is visible in the terminal pane content.

func HasUnsentComposerPrompt

func HasUnsentComposerPrompt(content, message string) bool

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

func HasUnsentPastedPrompt(content string) bool

HasUnsentPastedPrompt detects Claude's composer marker for a pasted-but-unsent prompt. Example: "[Pasted text #1 +89 lines]".

func IsComposerDividerLine

func IsComposerDividerLine(line string) bool

IsComposerDividerLine detects composer divider lines made of dash characters. Requires at least 10 consecutive dash-like characters (─, -, ━).

func NormalizePromptText

func NormalizePromptText(s string) string

NormalizePromptText normalizes whitespace in prompt text by replacing NBSP with regular spaces, trimming, and collapsing multiple whitespace runs.

func ParsePromptFromComposerBlock

func ParsePromptFromComposerBlock(lines []string) (string, bool)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL