feat(start-work): add plan name normalization and quote stripping
- Add WRAPPING_QUOTES_PATTERN to parse-user-request.ts to strip quotes from plan names
- Add normalizePlanLookupValue() to context-info-builder.ts for slug normalization
- Enhanced findPlanByName() with normalized exact and partial matching
- Allows human-readable plan names (e.g., "my feature plan") to match slugged filenames (e.g., my-feature-plan.md)
🤖 Generated with OhMyOpenCode assistance
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const KEYWORD_PATTERN = /\b(ultrawork|ulw)\b/gi
|
||||
const WORKTREE_FLAG_PATTERN = /--worktree(?:\s+(\S+))?/
|
||||
const WRAPPING_QUOTES_PATTERN = /^(["'`])([\s\S]*)\1$/
|
||||
|
||||
export interface ParsedUserRequest {
|
||||
planName: string | null
|
||||
@@ -21,9 +22,11 @@ export function parseUserRequest(promptText: string): ParsedUserRequest {
|
||||
}
|
||||
|
||||
const cleanedArg = rawArg.replace(KEYWORD_PATTERN, "").trim()
|
||||
const quotedPlanMatch = cleanedArg.match(WRAPPING_QUOTES_PATTERN)
|
||||
const normalizedPlanName = quotedPlanMatch ? quotedPlanMatch[2].trim() : cleanedArg
|
||||
|
||||
return {
|
||||
planName: cleanedArg || null,
|
||||
planName: normalizedPlanName || null,
|
||||
explicitWorktreePath,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user