cursorless
cursorless copied to clipboard
Add schema validation to Cursorless api boundary
For all places where the Cursorless extension ingests data from the outside world, we should validate against a schema. Here are a few such places:
- [ ] Cursorless command arguments (both primary
cursorless.commandaction and others, eg experimental keyboard) - [ ] Custom snippets (and built-in snippets)
- [ ] Settings
- [ ] other places?
We'd like to define these schemas using zod. This library will automatically allow Typescript to infer types. We can start by using ts-to-zod to generate initial schema
For custom snippets and settings, we can look into automatically generating json schema using zod-to-json-schema so that we have a single source of truth