Connecting your logic
Understanding the main components of the SDK

Input Schema
The input schema is based on Zod, because it is one of the most powerful static type inference toolings.
The schema makes the handler functions type-safe and enables you to define what the AI agent is allowed to fill in and what not. Giving you full control to reduce halluzinations. You can define multiple types
Preview handler (the human in the loop)
The preview handlers run immediately after CmdBar AI came up with an action flow. Its the place where you can make sure the input for the handler is valid and the user is fine with the selected data.

Handler (the action itself)
The handler runs for each action after the user hits "execute". It has the same capabilities and api as the previewHandler but its supposed used for executing the actual logic and only ask for input in edge cases.

Last updated