(memoryName: string)
| 72 | * Logs error and exits process if the memory name is invalid. |
| 73 | */ |
| 74 | export const validateMemoryName = (memoryName: string) => { |
| 75 | const validatedName = memoryNameSchema.safeParse(memoryName); |
| 76 | if (!validatedName.success) { |
| 77 | const err = fromZodError(validatedName.error).message; |
| 78 | p.cancel(`Invalid memory name: ${err}`); |
| 79 | process.exit(1); |
| 80 | } |
| 81 | return validatedName.data; |
| 82 | }; |
| 83 | |
| 84 | /** |
| 85 | * Validates the document embedding schema using the provided memory and document names. |
no test coverage detected