feat: subagent list dialog - done

This commit is contained in:
tanzhenxin
2025-09-04 23:29:47 +08:00
parent e44e28a640
commit 17b2c357a0
21 changed files with 701 additions and 976 deletions

View File

@@ -7,3 +7,16 @@ export const getColorForDisplay = (colorName?: string): string | undefined =>
!colorName || colorName === 'auto'
? undefined
: COLOR_OPTIONS.find((color) => color.name === colorName)?.value;
/**
* Sanitizes user input by removing dangerous characters and normalizing whitespace.
*/
export function sanitizeInput(input: string): string {
return (
input
.trim()
// eslint-disable-next-line no-control-regex
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '') // Remove control characters
.replace(/\s+/g, ' ') // Normalize whitespace
); // Limit length
}