9bbdfc41bd
Phase 7: Engine + extract + workflow-as-agent merged into execute package. All CLI imports migrated from @uncaged/workflow to specific packages. 105 CLI tests pass, 0 failures. Changes: - New @uncaged/workflow-execute package (engine/, extract/, workflow-as-agent) - CLI src/ and __tests__/ rewritten to import from split packages - bundle-validator updated to allow @uncaged/workflow-cas imports - ensure-uncaged-workflow-symlink creates symlinks for all new packages Ref: #143, closes #150
16 lines
566 B
TypeScript
16 lines
566 B
TypeScript
import { err, ok, type Result } from "@uncaged/workflow-protocol";
|
|
|
|
/** Validates a single path segment for workspace / template names (no separators, not `.` / `..`). */
|
|
export function validateWorkspaceSegment(name: string): Result<void, string> {
|
|
if (name.length === 0) {
|
|
return err("workspace name must not be empty");
|
|
}
|
|
if (name === "." || name === "..") {
|
|
return err("invalid workspace name");
|
|
}
|
|
if (name.includes("/") || name.includes("\\")) {
|
|
return err("workspace name must not contain path separators");
|
|
}
|
|
return ok(undefined);
|
|
}
|