-
Notifications
You must be signed in to change notification settings - Fork 2.3k
refactor: Use openapi for recipe endpoint types and in frontend #3548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c3491b9 to
f14cdc2
Compare
DOsinga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for doing this. this is so much better
| } | ||
|
|
||
| if (!recipe.instructions && !recipe.prompt) { | ||
| throw new Error('Recipe must have either instructions or prompt'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So nice
|
|
||
| // Add common optional fields | ||
| if (ext.env_keys && ext.env_keys.length > 0) { | ||
| if ('env_keys' in ext && ext.env_keys && ext.env_keys.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ext?.env_keys?.length) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types seem to be very unhappy with that approach for reasons that make no sense to me. :(
| // Convert toolCall to match API expectations | ||
| ...(content.type === 'toolRequest' && 'toolCall' in content | ||
| ? { | ||
| toolCall: content.toolCall as unknown as { [key: string]: unknown }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly a runtime risk with this conversion. Is there a way to determine the correct type?
* main: (32 commits) fix: use sequential when sub recipe task is 1. (#3573) fix: track message id to keep like with like (#3572) Replace mcp_core::prompt with rmcp::model types (#3561) feat (ui): close recipe modals with esc key (#3568) feat: recipes can retry with success criteria (#3474) Env var to set Ollama request timeout (#3516) Updating docs to match new UI (#3552) Improve Claude Code provider error message for missing CLI (#3363) feat: Work around Gemini API tool call quirks (#3328) feat(ui): Source CashSans-Bold and improve overall text rendering (#3091) refactor: Use openapi for recipe endpoint types and in frontend (#3548) Fix Google Analytics error for local dev (#3544) Extension Library Improvements (#3541) fix(ui): enable selection of zero-config providers in desktop GUI (#3378) refactor: Renames recipe route to recipes to be consistent (#3540) Blog: Orchestrating 6 Subagents to Build a Collaborative API Playground (#3528) Catch json errors a little better (#3437) Rust debug (#3510) refactor: Centralise deeplink encode and decode into server (#3489) feat: deprecate jetbrains extension in favor of public one (#2589) ...
* main: fix: use sequential when sub recipe task is 1. (#3573) fix: track message id to keep like with like (#3572) Replace mcp_core::prompt with rmcp::model types (#3561) feat (ui): close recipe modals with esc key (#3568) feat: recipes can retry with success criteria (#3474) Env var to set Ollama request timeout (#3516) Updating docs to match new UI (#3552) Improve Claude Code provider error message for missing CLI (#3363) feat: Work around Gemini API tool call quirks (#3328) feat(ui): Source CashSans-Bold and improve overall text rendering (#3091) refactor: Use openapi for recipe endpoint types and in frontend (#3548) Fix Google Analytics error for local dev (#3544)
…k#3548) Signed-off-by: Adam Tarantino <[email protected]>
Request from #3489 (comment)
This PR is primarily focused on converting the /recipes endpoints to use openapi schema. This includes converting the frontend types to use the same types as the the api interface. Unfortunately I couldn't go all the way in converting in one go due to how the frontend has bundled a bunch of extra config into recipes (particularly for schedules) and the PR was starting to get to big. So this PR converts the api and some frontend types but TODOs are left for more required refactoring.
Manually tested all the recipe interactions.