textutil

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInjectedPrompt added in v0.10.1

func IsInjectedPrompt(text string) bool

IsInjectedPrompt reports whether text is agent-injected rather than user-authored. It is the single source of truth for that question: callers that pick a session title, count user turns, or compact a transcript all use it so the classification cannot drift between them.

func StripIDEContextTags

func StripIDEContextTags(text string) string

StripIDEContextTags removes IDE-injected context tags from prompt text. The VSCode extension injects tags like:

  • <ide_opened_file>...</ide_opened_file> - currently open file
  • <ide_selection>...</ide_selection> - selected code in editor

Also removes system-injected tags like:

  • <local-command-caveat>...</local-command-caveat>
  • <system-reminder>...</system-reminder>
  • <command-name>...</command-name>

Cursor's <user_query> wrapper is unwrapped (content kept) and its prepended <timestamp> line is removed (content included, leading position only).

These shouldn't appear in commit messages or session descriptions. Not idempotent: the unwrap can expose user content at the start of the message, so callers must apply it exactly once per text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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