mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-10 00:42:18 +00:00
fix: broader activity classification for informal messages
- File extension patterns (.py, .json, .ts, etc.) trigger Coding - Script/API keywords (run, script, api, query, etc.) trigger Coding - URL patterns trigger Exploration - HTTP status codes (404, 500) trigger Debugging - "make a/me/the" and "write a/me/the" trigger Feature Dev - Catches informal Cursor messages that missed strict patterns
This commit is contained in:
parent
4597cbbd16
commit
6ba3691d24
1 changed files with 9 additions and 2 deletions
|
|
@ -5,12 +5,16 @@ const GIT_PATTERNS = /\bgit\s+(push|pull|commit|merge|rebase|checkout|branch|sta
|
|||
const BUILD_PATTERNS = /\b(npm\s+run\s+build|npm\s+publish|pip\s+install|docker|deploy|make\s+build|npm\s+run\s+dev|npm\s+start|pm2|systemctl|brew|cargo\s+build)\b/i
|
||||
const INSTALL_PATTERNS = /\b(npm\s+install|pip\s+install|brew\s+install|apt\s+install|cargo\s+add)\b/i
|
||||
|
||||
const DEBUG_KEYWORDS = /\b(fix|bug|error|broken|failing|crash|issue|debug|traceback|exception|stack\s*trace|not\s+working|wrong|unexpected)\b/i
|
||||
const FEATURE_KEYWORDS = /\b(add|create|implement|new|build|feature|introduce|set\s*up|scaffold|generate)\b/i
|
||||
const DEBUG_KEYWORDS = /\b(fix|bug|error|broken|failing|crash|issue|debug|traceback|exception|stack\s*trace|not\s+working|wrong|unexpected|status\s+code|404|500|401|403)\b/i
|
||||
const FEATURE_KEYWORDS = /\b(add|create|implement|new|build|feature|introduce|set\s*up|scaffold|generate|make\s+(?:a|me|the)|write\s+(?:a|me|the))\b/i
|
||||
const REFACTOR_KEYWORDS = /\b(refactor|clean\s*up|rename|reorganize|simplify|extract|restructure|move|migrate|split)\b/i
|
||||
const BRAINSTORM_KEYWORDS = /\b(brainstorm|idea|what\s+if|explore|think\s+about|approach|strategy|design|consider|how\s+should|what\s+would|opinion|suggest|recommend)\b/i
|
||||
const RESEARCH_KEYWORDS = /\b(research|investigate|look\s+into|find\s+out|check|search|analyze|review|understand|explain|how\s+does|what\s+is|show\s+me|list|compare)\b/i
|
||||
|
||||
const FILE_PATTERNS = /\.(py|js|ts|tsx|jsx|json|yaml|yml|toml|sql|sh|go|rs|java|rb|php|css|html|md|csv|xml)\b/i
|
||||
const SCRIPT_PATTERNS = /\b(run|execute|script|scrip?t|command|curl|api|endpoint|request|response|fetch|query|database|db)\b/i
|
||||
const URL_PATTERN = /https?:\/\/\S+/i
|
||||
|
||||
const EDIT_TOOLS = new Set(['Edit', 'Write', 'FileEditTool', 'FileWriteTool', 'NotebookEdit'])
|
||||
const READ_TOOLS = new Set(['Read', 'Grep', 'Glob', 'FileReadTool', 'GrepTool', 'GlobTool'])
|
||||
export const BASH_TOOLS = new Set(['Bash', 'BashTool', 'PowerShellTool'])
|
||||
|
|
@ -107,6 +111,9 @@ function classifyConversation(userMessage: string): TaskCategory {
|
|||
if (RESEARCH_KEYWORDS.test(userMessage)) return 'exploration'
|
||||
if (DEBUG_KEYWORDS.test(userMessage)) return 'debugging'
|
||||
if (FEATURE_KEYWORDS.test(userMessage)) return 'feature'
|
||||
if (FILE_PATTERNS.test(userMessage)) return 'coding'
|
||||
if (SCRIPT_PATTERNS.test(userMessage)) return 'coding'
|
||||
if (URL_PATTERN.test(userMessage)) return 'exploration'
|
||||
return 'conversation'
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue