mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
Re-adds the toggle in the install section that lets users download bundles with all user-invokable skills prefixed with i- (e.g. /i-audit) to avoid naming conflicts. Build now produces both unprefixed and prefixed variants for all providers and universal ZIP. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
865 B
JavaScript
28 lines
865 B
JavaScript
// Shared validation helpers for input sanitization
|
|
|
|
// Only allow alphanumeric, hyphens, and underscores in IDs
|
|
export const VALID_ID = /^[a-zA-Z0-9_-]+$/;
|
|
|
|
export const ALLOWED_PROVIDERS = [
|
|
'cursor', 'claude-code', 'gemini', 'codex', 'agents', 'universal',
|
|
'cursor-prefixed', 'claude-code-prefixed', 'gemini-prefixed', 'codex-prefixed', 'agents-prefixed', 'universal-prefixed',
|
|
];
|
|
export const ALLOWED_TYPES = ['skill', 'command'];
|
|
|
|
export function isValidId(id) {
|
|
return typeof id === 'string' && VALID_ID.test(id);
|
|
}
|
|
|
|
export function isAllowedProvider(provider) {
|
|
return ALLOWED_PROVIDERS.includes(provider);
|
|
}
|
|
|
|
export function isAllowedType(type) {
|
|
return ALLOWED_TYPES.includes(type);
|
|
}
|
|
|
|
// Sanitize a filename for use in Content-Disposition headers
|
|
export function sanitizeFilename(filename) {
|
|
return filename.replace(/[^a-zA-Z0-9._-]/g, '');
|
|
}
|