Expand description
User prompt submit hook handler.
Structsยง
- Capture
Signal - A detected signal for memory capture.
- User
Prompt Handler - Handles
UserPromptSubmithook events.
Constantsยง
- MAX_
SANITIZED_ ๐CONTENT_ LENGTH - Maximum length for sanitized content (CRIT-004).
Staticsยง
- BLOCKER_
PATTERNS ๐ - CAPTURE_
COMMAND ๐ - Explicit capture commands.
- DECISION_
PATTERNS ๐ - Signal patterns for memory capture detection.
- INJECTION_
PATTERNS ๐ - Patterns to sanitize from memory content before injection (CRIT-004). These patterns could be used for prompt injection attacks.
- LEARNING_
PATTERNS ๐ - PATTERN_
PATTERNS ๐ - SLASH_
COMMAND_ ๐PATTERN - Pattern to detect slash commands (e.g., /commit, /sigint:augment). These should not be echoed in hook output to prevent injection detection triggers.
- TECH_
DEBT_ ๐PATTERNS
Functionsยง
- build_
capture_ ๐context - Builds context message for capture (shows captured memory or suggestion).
- build_
memory_ ๐context_ text - Builds context message from memory context.
- calculate_
confidence ๐ - Calculates confidence score based on pattern matches.
- is_
slash_ ๐command - Checks if content looks like a slash command.
- safe_
content_ ๐preview - Safely formats content for display in hook output.
- sanitize_
for_ ๐context - Sanitizes memory content before injection into context (CRIT-004).
- truncate_
for_ ๐display - Truncates content for display in suggestions.