chore: add ion package, codesight wiki, work plans, ascli config
New @boocode/ion package (v0.0.1) for inference optimization network. .codesight/ wiki artifacts for codebase documentation. .omo/ work plans for openspec cleanup and enhanced file panel.
This commit is contained in:
27
packages/ion/src/engine/command-validation.ts
Normal file
27
packages/ion/src/engine/command-validation.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Command name validation for the Ion workflow engine.
|
||||
*
|
||||
* Command names must be lowercase kebab-case: lowercase alphanumeric
|
||||
* segments separated by single hyphens.
|
||||
*/
|
||||
|
||||
/** Pattern for valid command names: lowercase kebab-case. */
|
||||
const COMMAND_NAME_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
||||
|
||||
/**
|
||||
* Validate a command name.
|
||||
*
|
||||
* Valid names match the pattern: `^[a-z0-9]+(-[a-z0-9]+)*$`
|
||||
* - Lowercase alphanumeric segments
|
||||
* - Segments separated by single hyphens
|
||||
* - No leading or trailing hyphens
|
||||
* - No consecutive hyphens
|
||||
*
|
||||
* @returns `true` if the name is valid, `false` otherwise.
|
||||
*/
|
||||
export function isValidCommandName(name: string): boolean {
|
||||
if (name.length === 0) {
|
||||
return false;
|
||||
}
|
||||
return COMMAND_NAME_PATTERN.test(name);
|
||||
}
|
||||
Reference in New Issue
Block a user